Skip to content

Commit

Permalink
ci: pin node version using matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovicm67 committed Apr 17, 2024
1 parent 3989b70 commit 42d6efa
Showing 1 changed file with 19 additions and 31 deletions.
50 changes: 19 additions & 31 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
name: Test validation

on: [push, pull_request]
on:
- push
- pull_request

jobs:
check-constraint:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.env.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
env:
- os: ubuntu-latest
node: 20
- os: windows-latest
node: 20.12.1 # Pinned, because of https://github.com/approvals/Approvals.NodeJS/issues/176
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js (except for Windows)
if: ${{ runner.os != 'Windows' }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm

# https://github.com/approvals/Approvals.NodeJS/issues/176
- name: Set up Node.js (for Windows)
if: ${{ runner.os == 'Windows' }}
uses: actions/setup-node@v4
with:
node-version: '20.12.1'
node-version: ${{ matrix.env.node }}
cache: npm

- name: Install dependencies
Expand All @@ -50,13 +45,15 @@ jobs:
path: test

check-cube:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.env.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
env:
- os: ubuntu-latest
node: 20
- os: windows-latest
node: 20.12.1 # Pinned, because of https://github.com/approvals/Approvals.NodeJS/issues/176
profile:
- basic-cube-constraint
- standalone-constraint-constraint
Expand All @@ -67,19 +64,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js (except for Windows)
if: ${{ runner.os != 'Windows' }}
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm

# https://github.com/approvals/Approvals.NodeJS/issues/176
- name: Set up Node.js (for Windows)
if: ${{ runner.os == 'Windows' }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.12.1'
node-version: ${{ matrix.env.node }}
cache: npm

- name: Install dependencies
Expand Down

0 comments on commit 42d6efa

Please sign in to comment.