-
-
Notifications
You must be signed in to change notification settings - Fork 3
93 lines (78 loc) · 2.95 KB
/
rust.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: Rust
on:
workflow_dispatch:
push:
branches: [main, release-*]
pull_request:
branches: [main, release-*]
env:
CARGO_TERM_COLOR: always
jobs:
rust-build:
runs-on: ${{matrix.os}}
env:
DISPLAY: ':99'
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
headless: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- os: macos-latest
extra: -- --skip test_simple
- os: windows-latest
extra: -- --skip test_simple
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
# To only cache runs from `master`
save-if: ${{ github.ref == 'refs/heads/main' }}
- if: matrix.os == 'ubuntu-latest'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libxtst-dev libevdev-dev libxdo-dev
version: 1.0
- name: Add components
run: rustup component add clippy rustfmt
- name: Setup headless environment
run: ${{matrix.headless}}
- name: Rustfmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Build (minimal)
run: |
cargo test --no-run -p afrim-memory --verbose
cargo test --no-run -p afrim-preprocessor --no-default-features --verbose
cargo test --no-run -p afrim-translator --no-default-features --verbose
cargo test --no-run -p afrim-config --no-default-features --verbose
cargo test --no-run -p afrim --no-default-features --verbose
- name: Build (normal)
run: |
cargo test --no-run -p afrim-preprocessor --verbose
cargo test --no-run -p afrim-translator --verbose
cargo test --no-run -p afrim-config --verbose
cargo test --no-run -p afrim --verbose
- name: Build (full)
run: |
cargo test --no-run -p afrim-preprocessor --all-features --verbose
cargo test --no-run -p afrim --all-features --verbose
- name: Run tests (minimal)
run: |
cargo test -p afrim-memory --verbose
cargo test -p afrim-preprocessor --no-default-features --verbose
cargo test -p afrim-translator --no-default-features --verbose
cargo test -p afrim-config --no-default-features --verbose
cargo test -p afrim --no-default-features --verbose ${{matrix.extra}}
- name: Run tests (normal)
run: |
cargo test -p afrim-preprocessor --verbose
cargo test -p afrim-translator --verbose
cargo test -p afrim-config --verbose
cargo test -p afrim --verbose ${{matrix.extra}}
- name: Run tests (full)
run: |
cargo test -p afrim-preprocessor --all-features --verbose
cargo test -p afrim --all-features --verbose ${{matrix.extra}}