Skip to content

Commit 4d25c5f

Browse files
committed
Switch package manager to Yarn 3 and update CI jobs
1 parent e3d4529 commit 4d25c5f

File tree

8 files changed

+7670
-19594
lines changed

8 files changed

+7670
-19594
lines changed

.github/workflows/test.yml

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,48 @@ on:
88

99
jobs:
1010
build:
11-
name: Test Suite
11+
name: Lint, Test, Build & Pack on Node ${{ matrix.node }}
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node: ['16.x']
1316

1417
steps:
15-
- name: Checkout code
18+
- name: Checkout repo
1619
uses: actions/checkout@v2
1720

18-
- name: Set up Node
21+
- name: Use Node ${{ matrix.node }}
1922
uses: actions/setup-node@v2
2023
with:
21-
node-version: 16.x
22-
cache: 'npm'
24+
node-version: ${{ matrix.node }}
25+
cache: 'yarn'
2326

2427
- name: Install deps
25-
run: npm ci --ignore-scripts
28+
run: yarn install
29+
30+
# Read existing version, reuse that, add a Git short hash
31+
# - name: Set build version to Git commit
32+
# run: node scripts/writeGitVersion.js $(git rev-parse --short HEAD)
33+
34+
# - name: Check updated version
35+
# run: jq .version package.json
2636

2737
- name: Run linter
28-
run: npm run lint
38+
run: yarn lint
2939

3040
- name: Run tests
31-
run: npm test
41+
run: yarn test
3242

3343
- name: Compile
34-
run: npm run build
44+
run: yarn build
45+
46+
- name: Pack
47+
run: yarn pack
48+
49+
- uses: actions/upload-artifact@v2
50+
with:
51+
name: package
52+
path: packages/toolkit/package.tgz
3553

3654
test-types:
3755
name: Test Types with TypeScript ${{ matrix.ts }}
@@ -41,25 +59,26 @@ jobs:
4159
strategy:
4260
fail-fast: false
4361
matrix:
44-
ts: ['4.2', '4.3', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9']
62+
node: ['16.x']
63+
ts: ['4.2', '4.3', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '5.0']
4564

4665
steps:
47-
- name: Checkout code
66+
- name: Checkout repo
4867
uses: actions/checkout@v2
4968

50-
- name: Set up Node
69+
- name: Use node ${{ matrix.node }}
5170
uses: actions/setup-node@v2
5271
with:
53-
node-version: 14.x
54-
cache: 'npm'
72+
node-version: ${{ matrix.node }}
73+
cache: 'yarn'
5574

5675
- name: Install deps
57-
run: npm ci --ignore-scripts
76+
run: yarn install
5877

5978
- name: Install TypeScript ${{ matrix.ts }}
60-
run: npm install typescript@${{ matrix.ts }} --ignore-scripts
79+
run: yarn add typescript@${{ matrix.ts }}
6180

6281
- name: Test types
6382
run: |
64-
./node_modules/.bin/tsc --version
65-
npm run test:typescript
83+
yarn tsc --version
84+
yarn test:typescript

.gitignore

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,17 @@ coverage
44
lib
55
dist
66
es
7-
builds/
7+
builds/
8+
9+
10+
typesversions
11+
.cache
12+
.yarnrc
13+
.yarn/*
14+
!.yarn/patches
15+
!.yarn/releases
16+
!.yarn/plugins
17+
!.yarn/sdks
18+
!.yarn/versions
19+
.pnp.*
20+
*.tgz

.yarn/releases/yarn-3.2.4.cjs

Lines changed: 801 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-3.2.4.cjs

0 commit comments

Comments
 (0)