-
Notifications
You must be signed in to change notification settings - Fork 121
115 lines (107 loc) · 3.71 KB
/
ci_test.yml
File metadata and controls
115 lines (107 loc) · 3.71 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
name: Test
on:
merge_group:
types: [checks_requested]
push:
branches:
- master
paths:
- '**/*.rs'
- '**/Cargo.toml'
- '.github/workflows/ci_test.yml'
pull_request:
branches:
- master
paths:
- '**/*.rs'
- '**/Cargo.toml'
- '.github/workflows/ci_test.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ${{ matrix.setup.os }}
strategy:
matrix:
toolchain: ['nightly', 'beta', 'stable']
setup:
- os: 'ubuntu-22.04'
- os: 'ubuntu-22.04-arm'
- os: 'ubuntu-22.04'
features: 'sync'
- os: 'ubuntu-22.04'
features: 'polling' # fusion
- os: 'ubuntu-22.04'
features: 'io-uring-sqe128,io-uring-cqe32'
- os: 'ubuntu-22.04'
features: 'polling,ring'
no_default_features: true
- os: 'ubuntu-22.04'
features: 'polling,native-tls,ring'
no_default_features: true
- os: 'ubuntu-22.04'
features: 'native-tls,ring,py-dynamic-openssl'
- os: 'ubuntu-22.04'
target: 'x86_64-unknown-linux-musl'
features: 'native-tls-vendored,ring,sync,polling'
- os: 'windows-latest'
target: 'x86_64-pc-windows-msvc'
- os: 'windows-latest'
target: 'x86_64-pc-windows-gnu'
- os: 'windows-latest'
target: 'i686-pc-windows-msvc'
- os: 'windows-latest'
target: 'x86_64-pc-windows-msvc'
features: 'iocp-global'
- os: 'windows-latest'
target: 'x86_64-pc-windows-msvc'
features: 'iocp-wait-packet'
- os: 'windows-latest'
target: 'x86_64-pc-windows-msvc'
features: 'native-tls,ring,py-dynamic-openssl'
- os: 'windows-11-arm'
target: 'aarch64-pc-windows-msvc'
- os: 'macos-14'
- os: 'macos-15'
- os: 'macos-15'
features: 'native-tls,ring,py-dynamic-openssl'
steps:
- uses: actions/checkout@v6
- name: Setup Rust Toolchain
run: rustup toolchain install ${{ matrix.toolchain }}
- name: Setup target
if: ${{ matrix.setup.target }}
run: rustup +${{ matrix.toolchain }} target install ${{ matrix.setup.target }}
- uses: taiki-e/install-action@nextest
- name: Install musl
if: ${{ endsWith(matrix.setup.target, 'musl') }}
shell: bash
run: |
sudo apt-get -y install musl-dev musl-tools
- name: Test on ${{ matrix.setup.os }} ${{ matrix.toolchain }} ${{ matrix.setup.target }}
shell: bash
run: |
set -ex
ARGS=("--features" "all")
# Add feature "nightly" if toolchain is nightly
if [[ "${{ matrix.toolchain }}" == "nightly" ]]; then
ARGS+=("--features" "nightly")
fi
# Add features if features is not empty
if [[ -n "${{ matrix.setup.features }}" ]]; then
ARGS+=("--features" "${{ matrix.setup.features }}")
fi
# Add no-default-features if no_default_features is true
if [[ -n "${{ matrix.setup.no_default_features }}" ]]; then
ARGS+=("--no-default-features")
fi
# Specify target if target is not empty
if [[ -n "${{ matrix.setup.target }}" ]]; then
ARGS+=("--target" "${{ matrix.setup.target }}")
fi
cargo +${{ matrix.toolchain }} nextest run --profile ci "${ARGS[@]}"
cargo +${{ matrix.toolchain }} test --workspace --doc "${ARGS[@]}"