Skip to content

Commit 80a6277

Browse files
Fix CI for Yarn compat (#238)
1 parent d059923 commit 80a6277

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Use Node.js latest
1313
uses: actions/setup-node@v3
1414
with:
15-
cache: 'yarn'
15+
cache: "yarn"
1616
- name: Update Yarn cache
1717
env:
1818
YARN_ENABLE_SCRIPTS: false # disable post-install scripts
@@ -31,7 +31,7 @@ jobs:
3131
- name: Use Node.js latest
3232
uses: actions/setup-node@v3
3333
with:
34-
cache: 'yarn'
34+
cache: "yarn"
3535
- name: Install
3636
run: yarn install
3737
- name: Lint
@@ -56,20 +56,28 @@ jobs:
5656
- name: Use Node.js latest
5757
uses: actions/setup-node@v3
5858
with:
59-
node-version: ${{ matrix.node-version }}
60-
cache: 'yarn'
59+
cache: "yarn"
60+
- name: Downgrade Yarn and install
61+
if: ${{ matrix.node-version < 18 }}
62+
run: yarn set version 3 && yarn install --no-frozen-lockfile
6163
- name: Install
64+
if: ${{ matrix.node-version >= 18 }}
6265
run: yarn install
6366
- name: Build
6467
run: yarn build
68+
env:
69+
BABEL_ENV: production
70+
- name: Use Node.js ${{ matrix.node-version }}
71+
uses: actions/setup-node@v3
72+
with:
73+
node-version: ${{ matrix.node-version }}
6574
- name: Test on Node.js ${{ matrix.node-version }}
6675
# `maxWorkers` cannot be 1 because we are using `process.exitCode` in our tests.
6776
run: yarn jest --ci --color --maxWorkers=2
6877
env:
6978
BABEL_TYPES_8_BREAKING: true
7079
- name: Test the esm build
71-
run:
72-
yarn test:esm
80+
run: yarn test:esm
7381

7482
test-windows:
7583
name: Test on Windows
@@ -82,7 +90,7 @@ jobs:
8290
uses: actions/setup-node@v3
8391
with:
8492
node-version: latest
85-
cache: 'yarn'
93+
cache: "yarn"
8694
- name: Install
8795
run: yarn install
8896
- name: Build with bash
@@ -96,5 +104,4 @@ jobs:
96104
env:
97105
BABEL_TYPES_8_BREAKING: true
98106
- name: Test the esm build
99-
run:
100-
yarn test:esm
107+
run: yarn test:esm

0 commit comments

Comments
 (0)