chore(ci): use GitHub Actions to run unit tests on Windows and macOS (#6782)

Similar to our earlier Travis CI setup, we continue to run exhaustive checks on Linux, while also verifying the build + unit tests still work on other platforms.

Issue: #6726
This commit is contained in:
Mathias Bynens 2021-01-27 14:57:41 +01:00 committed by GitHub
parent cac540be3a
commit c49d10970f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,8 @@ on:
- main - main
jobs: jobs:
checks: linux-main-checks:
# https://github.com/actions/virtual-environments#available-environments
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
@ -77,3 +78,75 @@ jobs:
npm run test-install npm run test-install
# Undo those changes. # Undo those changes.
git checkout --force git checkout --force
macos:
# https://github.com/actions/virtual-environments#available-environments
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2
ref: ${{ github.head_ref }}
- name: Set up Node.js
uses: actions/setup-node@v1
with:
# Test only the oldest maintenance LTS Node.js version.
# https://github.com/nodejs/Release#release-schedule
node-version: 10
- name: Install dependencies
run: |
# Test platform-specific browser binary fetching for both
# Chromium and Firefox.
PUPPETEER_PRODUCT=firefox npm install
npm install
ls .local-chromium .local-firefox
- name: Build
run: |
npm run build
- name: Run unit tests
env:
CHROMIUM: true
run: |
npm run unit
windows:
# https://github.com/actions/virtual-environments#available-environments
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2
ref: ${{ github.head_ref }}
- name: Set up Node.js
uses: actions/setup-node@v1
with:
# Test only the oldest maintenance LTS Node.js version.
# https://github.com/nodejs/Release#release-schedule
node-version: 10
- name: Install dependencies
run: |
# Test platform-specific browser binary fetching for both
# Chromium and Firefox.
$env:PUPPETEER_PRODUCT='firefox'
npm install
Remove-Item Env:\PUPPETEER_PRODUCT
npm install
Get-ChildItem -Path .local-chromium,.local-firefox
- name: Build
run: |
npm run build
- name: Run unit tests
env:
CHROMIUM: true
run: |
npm run unit