-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (94 loc) · 2.52 KB
/
parallel-build.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Parallel build
on:
push:
branches-ignore:
- gh-pages
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Yarn Install
run: |
yarn install
- name: Lint
run: |
yarn lint
test:
name: Run Tests
runs-on: ubuntu-latest
# https://github.com/dependabot/dependabot-core/issues/3253#issuecomment-852541544
if: ${{ github.actor == 'dependabot[bot]' }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Yarn Install
run: |
yarn install
- name: Tests
run: |
export NG_CLI_ANALYTICS=false
yarn test
test-and-sonar:
name: Run Tests and Sonar Analysis
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Yarn Install
run: |
yarn install
- name: Sonar version
run: |
yarn sonar --version
- name: Tests and Sonar
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
./sonar-token-check.sh
export NG_CLI_ANALYTICS=false
yarn test
yarn sonar
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Yarn Install
run: |
yarn install
- name: Build
run: |
yarn build
- name: Archive built project
uses: actions/upload-artifact@v4
with:
name: timeismoney-dist
path: dist
retention-days: 1
deploy:
# make it work with skipped jobs: https://github.com/github/docs/issues/4822#issuecomment-826617890
if: ${{ (github.ref == 'refs/heads/main') && !failure() && !cancelled() }}
needs: [lint, test, test-and-sonar, build]
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Build Project
uses: actions/download-artifact@v4
with:
name: timeismoney-dist
path: dist
- name: List Current Folder
run: ls -R
- name: Deploy
# https://github.com/JamesIves/github-pages-deploy-action#configuration-
uses: JamesIves/[email protected]
with:
repository-name: wiiitek/timeismoney
branch: gh-pages
folder: ./dist/timeismoney
token: ${{ secrets.GH_TOKEN }}