Skip to content

Commit 107363a

Browse files
Merge pull request #234 from remarkablemark/ci/github
ci(github): timeout jobs after 5 min, cache node modules, & name steps
2 parents f8d44f1 + 5b76fc0 commit 107363a

File tree

2 files changed

+50
-12
lines changed

2 files changed

+50
-12
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,60 @@
11
name: build
22
on: [push, pull_request]
3+
34
jobs:
45
build:
56
runs-on: ubuntu-latest
7+
timeout-minutes: 5
68
strategy:
79
matrix:
810
node-version: [14]
11+
912
steps:
10-
- uses: actions/checkout@v2
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
1115
with:
1216
fetch-depth: 0
17+
1318
- name: Use Node.js ${{ matrix.node-version }}
14-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v2
1520
with:
1621
node-version: ${{ matrix.node-version }}
17-
- run: npm install
18-
- run: npx commitlint --from=HEAD~1
19-
- run: npm run lint
20-
- run: npm run lint:dts
21-
- run: npm run test:ci
22-
- run: npm run test:module
23-
- run: npm run test:integration
24-
- run: npm run benchmark
22+
23+
- name: Cache node modules
24+
uses: actions/cache@v2
25+
env:
26+
cache-name: cache-node-modules
27+
with:
28+
# npm cache files are stored in `~/.npm` on Linux/macOS
29+
path: ~/.npm
30+
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-node-
33+
34+
- name: Install dependencies
35+
run: npm install
36+
37+
- name: Lint commit message
38+
run: npx commitlint --from=HEAD~1
39+
40+
- name: Lint JavaScript files
41+
run: npm run lint
42+
43+
- name: Lint TypeScript declaration files
44+
run: npm run lint:dts
45+
46+
- name: Run unit tests
47+
run: npm run test:ci
48+
49+
- name: Run ES modules tests
50+
run: npm run test:module
51+
52+
- name: Run integration tests
53+
run: npm run test:integration
54+
55+
- name: Run benchmark
56+
run: npm run benchmark
57+
2558
- name: Coveralls
2659
uses: coverallsapp/github-action@master
2760
with:

.github/workflows/size-limit.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ on:
66
jobs:
77
size:
88
runs-on: ubuntu-latest
9+
timeout-minutes: 5
910
env:
1011
CI_JOB_NUMBER: 1
12+
1113
steps:
12-
- uses: actions/checkout@v2
13-
- uses: andresz1/size-limit-action@v1
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
17+
- name: Size Limit
18+
uses: andresz1/size-limit-action@v1
1419
with:
1520
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)