generated from nihalgonsalves/node-typescript-eslint-template
-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (44 loc) · 1.42 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# waiting on: https://github.com/actions/setup-node/issues/531
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: yarn install --immutable
- run: yarn format:check
- run: yarn lint
- run: yarn typecheck
- run: yarn build
- run: yarn test
- name: test built package on node@20
run: |
mkdir ../foo
cd ../foo
yarn init -y
yarn add esbuild-plugin-browserslist@"../esbuild-plugin-browserslist"
yarn install
echo "
const { esbuildPluginBrowserslist, resolveToEsbuildTarget } = require('esbuild-plugin-browserslist');
const assert = require('assert');
assert.strictEqual(esbuildPluginBrowserslist().name, 'esbuild-plugin-browserslist');
assert.strictEqual(resolveToEsbuildTarget(['chrome 90'])[0], 'chrome90');
" > test.js
node -v
node test.js
# Not using a matrix here since it's simpler
# to just duplicate it and not spawn new instances
- uses: actions/setup-node@v4
with:
node-version: 18
- name: test build package on node@18
run: |
cd ../foo
node -v
node test.js