Skip to content

Commit 14d31f8

Browse files
committed
build(workflows): Separate build and test workflow
- Separate and add flags to Codecov uploads
1 parent 30c8afa commit 14d31f8

File tree

2 files changed

+51
-11
lines changed

2 files changed

+51
-11
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
33

4-
name: Build and coverage
4+
name: Build all packages
55

66
on:
77
push:
@@ -29,15 +29,5 @@ jobs:
2929
cache: 'yarn'
3030
- name: Install dependencies
3131
run: yarn install --frozen-lockfile
32-
- name: Lint packages
33-
run: yarn lint
34-
- name: Test packages with coverage
35-
run: yarn test:coverage
3632
- name: Build packages
3733
run: yarn build
38-
- name: Upload coverage reports to Codecov
39-
uses: codecov/codecov-action@v3
40-
with:
41-
token: ${{ secrets.CODECOV_TOKEN }}
42-
directory: ./coverage/packages/
43-

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Lint and test with coverage all packages
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main", "next", "develop" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [18.x]
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: 'yarn'
30+
- name: Install dependencies
31+
run: yarn install --frozen-lockfile
32+
- name: Lint packages
33+
run: yarn lint
34+
- name: Test packages with coverage
35+
run: yarn test:coverage
36+
37+
- name: Upload use-long-press coverage reports to Codecov
38+
uses: codecov/codecov-action@v3
39+
with:
40+
token: ${{ secrets.CODECOV_TOKEN }}
41+
directory: ./coverage/packages/use-long-press
42+
flags: hooks,use-long-press
43+
44+
- name: Upload use-double-tap coverage reports to Codecov
45+
uses: codecov/codecov-action@v3
46+
with:
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
directory: ./coverage/packages/use-double-tap
49+
flags: hooks,use-double-tap
50+

0 commit comments

Comments
 (0)