Skip to content

Yarn v3, yarn cache and add windows to test matrix on gh #442

Yarn v3, yarn cache and add windows to test matrix on gh

Yarn v3, yarn cache and add windows to test matrix on gh #442

Workflow file for this run

# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [
14.x,
16.x,
# Deal with unhandled promise rejection in integration test:
# ERROR [karma-server]: Error: error:0308010C:digital envelope routines::unsupported
# , 18.x
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# https://github.com/actions/cache/blob/main/examples.md#node---yarn-2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
enableCrossOsArchive: true
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --immutable --immutable-cache
- name: Test (Linux)
id: test-linux
run: yarn test
if: runner.os == 'Linux'
- uses: ./.github/actions/test-windows
if: runner.os == 'Windows'
with:
os: ${{ matrix.os }}
node-version: ${{ matrix.node-version }}
- name: Build (Linux)
run: yarn build
id: build-linux
if: runner.os == 'Linux'