-
Notifications
You must be signed in to change notification settings - Fork 109
92 lines (84 loc) · 3.02 KB
/
tests.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
name: Test
permissions:
contents: read
on:
workflow_dispatch:
workflow_run:
workflows: ["Build"]
types:
- completed
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} # Only run if the build succeeded
strategy:
fail-fast: false
matrix:
rust:
- stable
- nightly
- "1.82.0"
platform:
- ubuntu-latest
- windows-latest
- macos-latest
features:
# The tests will fail on Ubuntu for libei and wayland, because the compositor of the Github runner does not support it
#- "libei,wayland,xdo,x11rb"
- "default"
#- "libei"
#- "wayland"
- "xdo"
- "x11rb"
exclude:
# The implementation on Windows and macOS does not have any features so we can reduce the number of combinations
#- platform: windows-latest
# features: "libei,wayland,xdo,x11rb"
#- platform: windows-latest
# features: "libei"
#- platform: windows-latest
# features: "wayland"
- platform: windows-latest
features: "xdo"
- platform: windows-latest
features: "x11rb"
#- platform: macos-latest
# features: "libei,wayland,xdo,x11rb"
#- platform: macos-latest
# features: "libei"
#- platform: macos-latest
# features: "wayland"
- platform: macos-latest
features: "xdo"
- platform: macos-latest
features: "x11rb"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
# If manually triggered, use the current commit (GITHUB_SHA), otherwise use the head_sha from the Build workflow
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- uses: ./.github/actions/install_deps
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- name: Setup headless display for tests on Linux
if: runner.os == 'Linux' # This step is only needed on Linux. The other OSs don't need to be set up
uses: ./.github/actions/headless_display
- name: Install Firefox on macOS
if: runner.os == 'macOS'
run: brew install --cask firefox
- name: Run the unit tests
run: cargo test unit --no-default-features --features ${{ matrix.features }} -- --test-threads=1 --nocapture
- name: Run the unit tests in release mode
run: cargo test unit --release --no-default-features --features ${{ matrix.features }} -- --test-threads=1 --nocapture
- name: Take screenshot
if: always() && runner.os != 'macOS'
uses: ./.github/actions/screenshot
with:
platform: ${{ matrix.platform }}
rust: ${{ matrix.rust }}
feature: ${{ matrix.features }}