-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (51 loc) · 1.51 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
on: push
name: Build Angular Application
permissions:
contents: write
issues: read
checks: write
statuses: read
pull-requests: write
jobs:
build:
if: github.ref != 'refs/heads/master'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 21.x]
steps:
- uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: npm install and npm run build
run: |
npm i
npm run build
npm test
# npm run lint
- name: Push Build to Releases
if: startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
artifacts: "dist/angular-githubaction/*"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: test-results/junit/*.xml
- name: Publish Unit Test Coverage Results
uses: romeovs/lcov-reporter-action@v0.2.21
with:
lcov-file: test-results/coverage/report-lcov/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}