Skip to content
Open

Test #19

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/deploy-on-push-to-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy

on:
push:
branches:
- 'main'

permissions:
id-token: write
pages: write
deployments: write

jobs:
docs:
name: '🌍 Deploy'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: '☁️ Checkout repository'
uses: actions/checkout@v3

- name: '⚙️ Use Node.js'
uses: actions/setup-node@v3
with:
check-latest: true
cache: 'npm'

- name: '⛓️ Install dependencies'
run: npm ci --no-optional --no-audit --prefer-offline --progress=false
- name: '🛠️ Build'
run: npm run build --prod

- name: Setup Pages
uses: actions/configure-pages@v2

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# dist directory of the application
path: './dist/github-actions-tutorial/'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
35 changes: 35 additions & 0 deletions .github/workflows/test-on-pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run Angular tests

on:
pull_request_target:
types: [opened, synchronize, reopened]

jobs:
docs:
name: 'Run Angular tests'
runs-on: ubuntu-latest

steps:

- name: '☁️ Checkout repository'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: '⚙️ Use Node.js'
uses: actions/setup-node@v3
with:
check-latest: true
cache: 'npm'

- name: '⚙️ Use Node.js'
uses: actions/setup-node@v3
with:
check-latest: true
cache: 'npm'

- name: '⛓️ Install dependencies'
run: npm ci --no-optional --no-audit --prefer-offline --progress=false

- name: 'Test'
run: npm test
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
</g>
</svg>

<span>{{ title }} app is running!</span>
<span>{{ title }} Hello World!</span>

<svg id="rocket-smoke" xmlns="http://www.w3.org/2000/svg" width="516.119" height="1083.632" viewBox="0 0 516.119 1083.632">
<title>Rocket Ship Smoke</title>
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ describe('AppComponent', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('github-actions-tutorial app is running!');
expect(compiled.querySelector('.content span')?.textContent).toContain('github-actions-tutorial Hello World!');
});
});