-
-
Notifications
You must be signed in to change notification settings - Fork 73
102 lines (91 loc) · 3.4 KB
/
LinuxCrossCompileTest.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
100
101
102
name: Linux cross compile tests
on:
push:
paths-ignore:
- '.devcontainer/**'
- '.gitpod.yml'
- '.vscode/**'
- 'tests/**'
pull_request:
paths-ignore:
- '.devcontainer/**'
- '.gitpod.yml'
- '.vscode/**'
- 'tests/**'
schedule:
# Run against the last commit on the default branch on Friday at 9pm (UTC?)
- cron: '0 21 * * 5'
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
# https://github.com/marketplace/actions/skip-duplicate-actions
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
linux-cross:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-latest
strategy:
# Continue running other jobs in the matrix even if one fails.
fail-fast: false
matrix:
platform:
- target: aarch64-unknown-linux-musl
rust-version: stable
- target: i686-unknown-linux-musl
rust-version: stable
- target: armv7-unknown-linux-musleabihf
rust-version: stable
# Platforms without AtomicU64 support.
- target: armv5te-unknown-linux-musleabi
cargo-opts: "--no-default-features" # Disable atomic64 and quanta features.
rust-version: stable
- target: mips-unknown-linux-musl
cargo-opts: "--no-default-features" # Disable atomic64 and quanta features.
rust-version: "1.72.1"
cargo-version: "+1.72.1"
- target: mipsel-unknown-linux-musl
cargo-opts: "--no-default-features" # Disable atomic64 and quanta features.
rust-version: "1.72.1"
cargo-version: "+1.72.1"
steps:
- name: Checkout Moka
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.platform.rust-version }}
targets: ${{ matrix.platform.target }}
- name: Install cross
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Remove integration tests and force enable rustc_version crate
run: |
rm -rf tests
sed -i '/actix-rt\|async-std\|reqwest/d' Cargo.toml
sed -i 's/target.*rustver.*\.//' Cargo.toml
sed -i 's/build = "build.rs"/build = ".ci_extras\/build_linux_cross.rs"/' Cargo.toml
cat Cargo.toml
- run: cargo clean
- name: Run tests (sync feature)
run: |
cross ${{ matrix.platform.carge-version }} test --release -F sync \
--target ${{ matrix.platform.target }} ${{ matrix.platform.cargo-opts }}
env:
RUSTFLAGS: '--cfg rustver'
- name: Run tests (future feature)
run: |
cross ${{ matrix.platform.cargo-version }} test --release -F future \
--target ${{ matrix.platform.target }} ${{ matrix.platform.cargo-opts }}
- name: Run tests (sync feature, drop cache)
run: |
cross ${{ matrix.platform.cargo-version }} test --release -F sync \
--target ${{ matrix.platform.target }} ${{ matrix.platform.cargo-opts }} \
--lib sync::cache::tests::ensure_gc_runs_when_dropping_cache -- --exact --ignored