-
Notifications
You must be signed in to change notification settings - Fork 22
99 lines (99 loc) · 5.99 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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
# yarn cache clean && yarn config delete proxy && yarn config delete https-proxy && yarn config delete registry &&
run: 'yarn install --network-timeout 1000000'
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 || echo OK
- 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 || echo OK