fix: GH ACTIONS compare Electron Puppeteer task #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
tags-ignore: | |
- '*' | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
# if: "!contains(toJSON(github.event.commits.*.message), '[skip-ci]')" | |
if: "github.event_name == 'pull_request' || !contains(github.event.head_commit.message, 'skip ci')" | |
# runs-on: ubuntu-latest # / ubuntu-18.04 ... or ubuntu-16.04, ubuntu-20.04 | |
# runs-on: macos-latest # / macos-10.15 | |
# runs-on: windows-2016 # not window-latest / windows-2019, see https://github.com/edrlab/thorium-reader/issues/1591 | |
runs-on: ${{ matrix.runson }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# windows-arm | |
osarch: [windows-intel, macos-intel, macos-arm, linux-intel, linux-arm] | |
include: | |
- osarch: windows-intel | |
runson: windows-latest | |
# - osarch: windows-arm | |
# runson: windows-latest | |
- osarch: macos-intel | |
runson: macos-13 | |
- osarch: macos-arm | |
runson: macos-latest | |
- osarch: linux-intel | |
runson: ubuntu-20.04 | |
- osarch: linux-arm | |
runson: ubuntu-20.04 | |
env: | |
DBUS_SYSTEM_BUS_ADDRESS: 'unix:path=/var/run/dbus/system_bus_socket' | |
DBUS_SESSION_BUS_ADDRESS: 'unix:path=/var/run/dbus/system_bus_socket' | |
steps: | |
- run: 'echo "GITHUB_RUN_NUMBER: ${{ github.run_number }}"' | |
- run: 'echo "GITHUB_RUN_ID: ${{ github.run_id }}"' | |
- run: 'echo "GITHUB_SHA: ${{ github.sha }}"' | |
- name: Check sys arch | |
if: ${{ matrix.osarch != 'windows-intel' }} | |
run: echo "${{ matrix.osarch }}" && uname -m && arch | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Git config global dump (post) | |
run: 'git config --global --list || echo NO_GIT_GLOBAL_CONFIG || true' | |
shell: bash | |
- name: Git config local dump (post) | |
run: 'git config --list || echo NO_GIT_GLOBAL_CONFIG || true' | |
shell: bash | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
#check-latest: true | |
- run: node --version && npm --version | |
- run: npm --global install npm@^10 | |
- run: npm --version | |
- run: npm --global install yarn@^1 | |
- run: yarn --version | |
- run: git --no-pager diff | |
# - run: yarn install --frozen-lockfile | |
- name: YARN install | |
run: 'yarn install' | |
shell: bash | |
# - name: PR action | |
# if: ${{ github.event_name == 'pull_request' }} | |
# run: echo PR | |
- name: non-PR action, Windows, Puppeteer | |
if: ${{ github.event_name != 'pull_request' && ( matrix.osarch == 'windows-intel' || matrix.osarch == 'windows-arm' ) }} | |
run: echo "${{ matrix.osarch }}" && yarn test && yarn test-cli | |
- name: non-PR action, Windows, Electron | |
if: ${{ github.event_name != 'pull_request' && ( matrix.osarch == 'windows-intel' || matrix.osarch == 'windows-arm' ) }} | |
run: echo "${{ matrix.osarch }}" && yarn test-electron && yarn test-electron-cli | |
- name: non-PR action, Linux, Puppeteer | |
if: ${{ github.event_name != 'pull_request' && (matrix.osarch == 'linux-intel' || matrix.osarch == 'linux-arm') }} | |
run: echo "${{ matrix.osarch }}" && yarn test && yarn test-cli | |
- name: non-PR action, Linux, Electron | |
if: ${{ github.event_name != 'pull_request' && (matrix.osarch == 'linux-intel' || matrix.osarch == 'linux-arm') }} | |
# uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a #v1 | |
# with: | |
# run: yarn test-electron && yarn test-electron-cli | |
# working-directory: ./ | |
# # options: | |
run: echo "${{ matrix.osarch }}" && xvfb-run --auto-servernum yarn test-electron-cli && xvfb-run --auto-servernum yarn test-electron | |
- name: non-PR action, Mac, Puppeteer | |
if: ${{ github.event_name != 'pull_request' && (matrix.osarch == 'macos-intel' || matrix.osarch == 'macos-arm') }} | |
run: echo "${{ matrix.osarch }}" && yarn test && yarn test-cli | |
- name: non-PR action, Mac, Electron | |
if: ${{ github.event_name != 'pull_request' && (matrix.osarch == 'macos-intel' || matrix.osarch == 'macos-arm') }} | |
run: echo "${{ matrix.osarch }}" && yarn test-electron && yarn test-electron-cli | |
- name: non-PR action, Linux, Puppeteer vs. Electron test | |
if: ${{ github.event_name != 'pull_request' && (matrix.osarch == 'linux-intel' || matrix.osarch == 'linux-arm') }} | |
run: echo "${{ matrix.osarch }}" && rm -rf ./CompareAxeRunners && ACE_PERF=1 xvfb-run --auto-servernum node ./packages/ace/bin/ace-electron.js -f -s -o ./CompareAxeRunners/ElectronAxeRunner ./tests/data/issue-290.epub && ACE_PERF=1 xvfb-run --auto-servernum node ./packages/ace-cli/bin/ace.js -f -s -o ./CompareAxeRunners/PuppeteerAxeRunner ./tests/data/issue-290.epub && node ./scripts/normalise_report_json.js ./CompareAxeRunners/PuppeteerAxeRunner/report.json && node ./scripts/normalise_report_json.js ./CompareAxeRunners/ElectronAxeRunner/report.json && node node_modules/json-diff/bin/json-diff.js ./CompareAxeRunners/PuppeteerAxeRunner/report_normalised.json ./CompareAxeRunners/ElectronAxeRunner/report_normalised.json | |
- name: non-PR action, Mac, Puppeteer vs. Electron test | |
if: ${{ github.event_name != 'pull_request' && (matrix.osarch == 'macos-intel' || matrix.osarch == 'macos-arm') }} | |
run: echo "${{ matrix.osarch }}" && rm -rf ./CompareAxeRunners && ACE_PERF=1 node ./packages/ace/bin/ace-electron.js -f -s -o ./CompareAxeRunners/ElectronAxeRunner ./tests/data/issue-290.epub && ACE_PERF=1 node ./packages/ace-cli/bin/ace.js -f -s -o ./CompareAxeRunners/PuppeteerAxeRunner ./tests/data/issue-290.epub && node ./scripts/normalise_report_json.js ./CompareAxeRunners/PuppeteerAxeRunner/report.json && node ./scripts/normalise_report_json.js ./CompareAxeRunners/ElectronAxeRunner/report.json && node node_modules/json-diff/bin/json-diff.js ./CompareAxeRunners/PuppeteerAxeRunner/report_normalised.json ./CompareAxeRunners/ElectronAxeRunner/report_normalised.json |