-
Notifications
You must be signed in to change notification settings - Fork 12
159 lines (133 loc) · 5.21 KB
/
Copy pathtest.yaml
File metadata and controls
159 lines (133 loc) · 5.21 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: test
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
jobs:
run:
strategy:
# Don't give up on the whole matrix if one variant fails.
fail-fast: false
matrix:
# Keep targets archs in sync with `latest-dependencies.yaml`. Use
# specific versions of runner OS here and latest ones in
# `latest-dependencies.yaml`.
include:
- target: aarch64-apple-darwin
runner_os: macos-14
- target: aarch64-apple-darwin
runner_os: macos-15
- target: aarch64-apple-darwin
runner_os: macos-26
- target: aarch64-unknown-linux-gnu
runner_os: ubuntu-24.04-arm
- target: aarch64-unknown-linux-gnu
runner_os: ubuntu-26.04-arm
- target: aarch64-unknown-linux-musl
runner_os: ubuntu-24.04-arm
- target: aarch64-unknown-linux-musl
runner_os: ubuntu-26.04-arm
- target: aarch64-pc-windows-msvc
runner_os: windows-11-arm
- target: armv7-unknown-linux-gnueabihf
runner_os: ubuntu-24.04
# Build on Ubuntu 26.04 fails: <https://github.com/Mbed-TLS/mbedtls/issues/9875>
# TODO: Re-enable when fixed.
#- target: armv7-unknown-linux-gnueabihf
# runner_os: ubuntu-26.04
- target: x86_64-apple-darwin
runner_os: macos-15-intel
- target: x86_64-apple-darwin
runner_os: macos-26-intel
- target: x86_64-pc-windows-msvc
runner_os: windows-2022
- target: x86_64-pc-windows-msvc
runner_os: windows-2025
- target: x86_64-unknown-linux-gnu
runner_os: ubuntu-24.04
- target: x86_64-unknown-linux-gnu
runner_os: ubuntu-26.04
- target: x86_64-unknown-linux-musl
runner_os: ubuntu-24.04
- target: x86_64-unknown-linux-musl
runner_os: ubuntu-26.04
runs-on: ${{ matrix.runner_os }}
steps:
- name: Adjust build settings for Windows
if: startsWith(matrix.runner_os, 'windows-')
# Required for Windows builds: for version numbers with pre-release part
# as suffix, the resulting paths would get too long to build otherwise.
#
# Windows 2025 and later do not provision a drive D and we have to use the main drive C:
# for Cargo build artifacts: <https://github.com/actions/runner-images/issues/12416>
run: >-
echo "CARGO_TARGET_DIR=C:\t" >> $env:GITHUB_ENV
- name: Install Rust toolchain
# Use specific Rust version that is the minimum supported `rust-version`
# (MSRV) from `Cargo.toml`.
# Specify the Rust toolchain explicitly to prevent issues with Dependabot.
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.85"
targets: ${{ matrix.target }}
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
# Setting the target sets the `CARGO_BUILD_TARGET` environment variable,
# so there is no need for an explicit `--target` flag in each build step.
# This is required for both native and cross-platform builds to avoid
# using the default target of the runner.
target: ${{ matrix.target }}
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Install Cargo helpers
run: >-
cargo binstall cargo-hack
# Check out the repository before the remaining steps that depend on it.
# All preceding steps are independent of the repository contents.
- name: Check out repository
uses: actions/checkout@v7
with:
persist-credentials: false
submodules: recursive
- name: Cache Rust toolchain and build artifacts
uses: Swatinem/rust-cache@v2
with:
# The cache should not be shared between different workflows, jobs, and targets.
shared-key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.target }}-${{ matrix.runner_os }}
- name: Build with feature combinations
run: >-
cargo hack --each-feature
build --locked
- name: Run tests (bins/lib/tests/examples) with feature combinations
run: >-
cargo hack --each-feature
test --locked
--bins --lib --tests --examples
# Compile and run doctests, which have been excluded in the previous
# step(s).
#
# Doctests may use any features and there is no easy way to activate
# certain features only for some doctests, so we run them without
# `cargo-hack`.
- name: Run doctests with all features enabled
run: >-
cargo test
--locked --all-features
--doc
- name: Build package with all features enabled
run: >-
cargo package
--locked --all-features