File tree 5 files changed +52
-16
lines changed
5 files changed +52
-16
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,6 @@ name: Build
2
2
3
3
on :
4
4
workflow_call :
5
- inputs :
6
- node-version :
7
- required : false
8
- type : string
9
- default : ' 18.x'
10
5
11
6
jobs :
12
7
build :
Original file line number Diff line number Diff line change 12
12
CI : false
13
13
14
14
jobs :
15
- run-build :
16
- uses : ./.github/workflows/build-reusable.yml
15
+ test :
16
+ uses : ./.github/workflows/test.yml
17
+
18
+ build :
19
+ uses : ./.github/workflows/build.yml
20
+ needs : test
17
21
18
22
deploy :
19
23
runs-on : ubuntu-22.04
20
- needs : run- build
24
+ needs : build
21
25
steps :
22
26
- name : Checkout source code
23
27
uses : actions/checkout@v3
Original file line number Diff line number Diff line change 9
9
workflow_dispatch :
10
10
11
11
jobs :
12
+ test :
13
+ uses : ./.github/workflows/test.yml
14
+
12
15
build :
13
16
name : Build image
14
17
runs-on : ubuntu-22.04
18
+ needs : test
15
19
16
20
steps :
17
21
- name : Set env variables
Original file line number Diff line number Diff line change 1
- name : Build and test Pull Request
1
+ name : Pull Request checks
2
2
3
3
on :
4
4
pull_request :
5
5
6
6
jobs :
7
- run- build :
8
- uses : ./.github/workflows/build-reusable .yml
7
+ build :
8
+ uses : ./.github/workflows/build.yml
9
9
10
10
test :
11
- runs-on : ubuntu-22.04
12
- needs : run-build
13
- steps :
14
- - name : Run unit tests
15
- run : npm run frontend:test
11
+ uses : ./.github/workflows/test.yml
16
12
Original file line number Diff line number Diff line change
1
+ name : Unit tests
2
+
3
+ on :
4
+ workflow_call :
5
+
6
+ jobs :
7
+ test :
8
+ runs-on : ubuntu-22.04
9
+ steps :
10
+ - name : Checkout source code
11
+ uses : actions/checkout@v3
12
+
13
+ - name : Setup Node
14
+ uses : actions/setup-node@v3
15
+ with :
16
+ node-version : 18.x
17
+
18
+ - name : Get version from package.json
19
+ id : package-version
20
+ run : |
21
+ echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
22
+ echo "Project Version: $VERSION"
23
+
24
+ - name : Cache node_modules
25
+ uses : actions/cache@v3
26
+ id : cache-npm-packages
27
+ with :
28
+ path : node_modules
29
+ key : ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
30
+
31
+ - name : Install NPM dependencies
32
+ if : steps.cache-npm-packages.outputs.cache-hit != 'true'
33
+ run : npm clean-install
34
+
35
+ - name : Run frontend unit tests
36
+ run : npm run frontend:test
37
+
You can’t perform that action at this time.
0 commit comments