Skip to content

Commit

Permalink
meta: split Companion CI between Node.js legacy and supported versions (
Browse files Browse the repository at this point in the history
#3776)

* meta: split Companion CI between Node.js legacy and supported versions
* start testing on 18.x
  • Loading branch information
aduh95 authored May 24, 2022
1 parent 6f9813d commit e3c4339
Showing 1 changed file with 35 additions and 6 deletions.
41 changes: 35 additions & 6 deletions .github/workflows/companion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ on:
types: [ opened, synchronize, reopened ]

jobs:
test:
name: Unit tests
test-legacy:
name: Unit tests (legacy)
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.20.1, 12.x, 14.x, 16.x, 17.x]
node-version: [10.20.1, 12.x, 17.x]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install Corepack if needed
run: corepack -v || npm install -g corepack
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"
Expand All @@ -33,8 +31,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node-version}}
- name: Install Corepack if needed
run: corepack -v || npm install -g corepack
- name: Install dependencies
run: corepack yarn install --immutable
run: corepack yarn@3.1.1 install --no-immutable
env:
# Necessary for Node.js v10.x
NODE_OPTIONS: --experimental-worker
Expand All @@ -45,3 +45,32 @@ jobs:
# Necessary for Node.js v10.x
NODE_OPTIONS: --experimental-worker
YARN_IGNORE_NODE: 1
test:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node-version}}
- name: Install dependencies
run: corepack yarn install --immutable
- name: Run tests
run: corepack yarn run test:companion

0 comments on commit e3c4339

Please sign in to comment.