Skip to content

Commit 855e7ab

Browse files
committed
Run lint and units concurrently
1 parent 787fd4d commit 855e7ab

File tree

1 file changed

+41
-9
lines changed

1 file changed

+41
-9
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,48 @@ env:
1919
BRANCH: ${{ github.base_ref }}
2020

2121
jobs:
22-
build:
23-
name: koku-ui build
22+
lint:
23+
name: Lint
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: 18
34+
35+
- name: Cache node modules
36+
id: cache-npm
37+
uses: actions/cache@v4
38+
env:
39+
cache-name: cache-node-modules
40+
with:
41+
# npm cache files are stored in `~/.npm` on Linux/macOS
42+
path: ~/.npm
43+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
44+
restore-keys: |
45+
${{ runner.os }}-build-${{ env.cache-name }}-
46+
${{ runner.os }}-build-
47+
${{ runner.os }}-
48+
49+
- name: Install dependencies
50+
run: npm install
51+
52+
- name: Lint
53+
run: npm run lint
54+
55+
units:
56+
name: Units - ${{ matrix.node-version }}
2457
runs-on: ubuntu-latest
2558
strategy:
2659
matrix:
27-
node-version: [18]
60+
fail-fast: false
61+
node-version:
62+
- '18'
63+
2864
steps:
2965
- name: Checkout code
3066
uses: actions/checkout@v4
@@ -54,16 +90,12 @@ jobs:
5490
- name: Build
5591
run: npm run build
5692

57-
- name: Lint
58-
if: ${{ success() }}
59-
run: npm run lint
60-
6193
- name: Test
62-
if: ${{ success() }}
94+
id: test
6395
run: npm test -- --collect-coverage --max-workers=4
6496

6597
- name: Upload coverage report
66-
if: ${{ success() }}
98+
if: steps.test.outcome == 'success'
6799
uses: codecov/[email protected]
68100
env:
69101
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)