Skip to content

Commit f0e2f3c

Browse files
authored
Merge pull request #1001 from github/henrymercer/pr-check-validate-node-12-build
Add PR check to validate compatibility with Node 12
2 parents 8237e85 + 73ba7ff commit f0e2f3c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/pr-checks.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,34 @@ jobs:
2424
runs-on: ubuntu-latest
2525
timeout-minutes: 45
2626

27+
strategy:
28+
fail-fast: true
29+
matrix:
30+
node-types-version: [12.12, current]
31+
2732
steps:
2833
- uses: actions/checkout@v2
34+
35+
- name: Update version of @types/node
36+
if: matrix.node-types-version != 'current'
37+
env:
38+
NODE_TYPES_VERSION: ${{ matrix.node-types-version }}
39+
run: |
40+
# Export `NODE_TYPES_VERSION` so it's available to jq
41+
export NODE_TYPES_VERSION="${NODE_TYPES_VERSION}"
42+
contents=$(jq '.devDependencies."@types/node" = env.NODE_TYPES_VERSION' package.json)
43+
echo "${contents}" > package.json
44+
# Usually we run `npm install` on macOS to ensure that we pick up macOS-only dependencies.
45+
# However we're not checking in the updated lockfile here, so it's fine to run
46+
# `npm install` on Linux.
47+
npm install
48+
49+
git config --global user.email "[email protected]"
50+
git config --global user.name "github-actions[bot]"
51+
# The period in `git add --all .` ensures that we stage deleted files too.
52+
git add --all .
53+
git commit -m "Use @types/node=${NODE_TYPES_VERSION}"
54+
2955
- name: Check generated JS
3056
run: .github/workflows/script/check-js.sh
3157

0 commit comments

Comments
 (0)