From c49d10970f7ca0848fd7cab2511a6af98c255143 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Wed, 27 Jan 2021 14:57:41 +0100 Subject: [PATCH] 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 --- .github/workflows/main.yml | 75 +++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0bbbc6ca..91b41eac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,8 @@ on: - main jobs: - checks: + linux-main-checks: + # https://github.com/actions/virtual-environments#available-environments runs-on: ubuntu-latest strategy: matrix: @@ -77,3 +78,75 @@ jobs: npm run test-install # Undo those changes. 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