Skip to content

Commit 7b04f6e

Browse files
committed
ci: move to GitHub Actions
1 parent 33d32bd commit 7b04f6e

File tree

5 files changed

+77
-80
lines changed

5 files changed

+77
-80
lines changed

.circleci/config.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

.github/actions/setup/action.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v3
9+
with:
10+
node-version-file: .nvmrc
11+
12+
- name: Cache dependencies
13+
id: yarn-cache
14+
uses: actions/cache@v3
15+
with:
16+
path: |
17+
**/node_modules
18+
.yarn/install-state.gz
19+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
20+
restore-keys: |
21+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
22+
${{ runner.os }}-yarn-
23+
24+
- name: Install dependencies
25+
if: steps.yarn-cache.outputs.cache-hit != 'true'
26+
run: yarn install --frozen-lockfile
27+
shell: bash

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Setup
18+
uses: ./.github/actions/setup
19+
20+
- name: Lint files
21+
run: yarn lint
22+
23+
- name: Typecheck files
24+
run: yarn typecheck
25+
26+
test:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
32+
- name: Setup
33+
uses: ./.github/actions/setup
34+
35+
- name: Run unit tests
36+
run: yarn test --maxWorkers=2 --coverage
37+
38+
- name: Upload test coverage
39+
run: yarn codecov
40+
41+
- name: Store test coverage
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: coverage
45+
path: coverage

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"scripts": {
2323
"test": "jest",
2424
"lint": "eslint .",
25-
"typescript": "tsc --noEmit",
25+
"typecheck": "tsc --noEmit",
2626
"release": "release-it"
2727
},
2828
"publishConfig": {
@@ -61,7 +61,8 @@
6161
},
6262
"husky": {
6363
"hooks": {
64-
"pre-commit": "yarn lint && yarn typescript && yarn test"
64+
"pre-commit": "yarn lint && yarn typecheck && yarn test"
6565
}
66-
}
66+
},
67+
"packageManager": "[email protected]"
6768
}

0 commit comments

Comments
 (0)