Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit 46a9a0a

Browse files
committed
Split build and test stage
1 parent 71cefba commit 46a9a0a

2 files changed

Lines changed: 45 additions & 4 deletions

File tree

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ indent_size = 4
88
insert_final_newline = true
99
tab_width = 4
1010
trim_trailing_whitespace = true
11+
12+
[.github/workflows/*.yml]
13+
indent_size = 2
14+
tab_width = 2

.github/workflows/ci.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,43 @@ on:
1414
jobs:
1515
build:
1616
runs-on: ubuntu-latest
17+
env:
18+
NODE_VERSION: 18
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Use Node.js ${{ env.NODE_VERSION }}
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: ${{ env.NODE_VERSION }}
25+
- name: Get npm cache directory
26+
id: npm-cache-dir
27+
run: |
28+
echo "::set-output name=dir::$(npm config get cache)"
29+
- name: Cache root node_modules
30+
id: cache-npm-root
31+
uses: actions/cache@v3
32+
with:
33+
path: |
34+
${{ steps.npm-cache-dir.outputs.dir }}
35+
./node_modules
36+
key: ${{ runner.os }}-node-root-${{ hashFiles('./package-lock.json') }}
37+
restore-keys: |
38+
${{ runner.os }}-node-root-
39+
- name: Install dependencies
40+
if: ${{ steps.cache-npm-root.outputs.cache-hit != 'true' }}
41+
run: npm ci
42+
- name: Lerna bootstrap
43+
run: npx lerna bootstrap
44+
- name: Build
45+
run: npx lerna run build
46+
47+
test:
48+
runs-on: ubuntu-latest
49+
needs: build
1750
strategy:
1851
matrix:
19-
node-version: [12.x, 14.x, 16.x, 18.x]
52+
# node-version: [12, 14, 16, 18]
53+
node-version: [18]
2054
steps:
2155
- uses: actions/checkout@v2
2256
- name: Use Node.js ${{ matrix.node-version }}
@@ -42,15 +76,18 @@ jobs:
4276
run: npm ci
4377
- name: Lerna bootstrap
4478
run: npx lerna bootstrap
45-
- name: Build
46-
run: npx lerna run build
4779
- name: Test
4880
run: npx lerna run test
4981
env:
5082
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
- name: Find coverage files
84+
id: coverage-files
85+
run: |
86+
LCOV_FILES=$(find packages/ -type f -name "lcov.info" | paste -s -d ',' -)
87+
echo "::set-output name=list::$LCOV_FILES"
5188
- name: Run codacy-coverage-reporter
5289
if: github.event_name == 'push'
5390
uses: codacy/codacy-coverage-reporter-action@master
5491
with:
5592
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
56-
coverage-reports: coverage/lcov.info
93+
coverage-reports: ${{ steps.coverage-files.outputs.list }}

0 commit comments

Comments
 (0)