-
Notifications
You must be signed in to change notification settings - Fork 14
142 lines (135 loc) · 5.23 KB
/
Copy pathci.yml
File metadata and controls
142 lines (135 loc) · 5.23 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
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
tags:
- '*'
name: Build
jobs:
check:
name: Check
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.85.0
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: "cargo check"
run: cargo check
test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.85.0
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: "cargo test"
run: cargo test
- name: "cargo test (no default features)"
run: cargo test --tests --no-default-features
- name: "cargo test (all features)"
run: cargo test --all-features
run:
name: Run examples
strategy:
fail-fast: false
matrix:
job:
# Ubuntu 24.04
- { os: ubuntu-24.04, target: x86_64-unknown-linux-gnu, use-cross: false }
- { os: ubuntu-24.04, target: x86_64-unknown-linux-musl, use-cross: true }
- { os: ubuntu-24.04, target: arm-unknown-linux-gnueabihf, use-cross: true }
- { os: ubuntu-24.04, target: aarch64-unknown-linux-gnu, use-cross: true }
- { os: ubuntu-24.04, target: i586-unknown-linux-gnu, use-cross: true }
- { os: ubuntu-24.04, target: i686-unknown-linux-gnu, use-cross: true }
- { os: ubuntu-24.04, target: i686-unknown-linux-musl, use-cross: true }
# Ubuntu 22.04
- { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu, use-cross: false }
- { os: ubuntu-22.04, target: x86_64-unknown-linux-musl, use-cross: true }
- { os: ubuntu-22.04, target: arm-unknown-linux-gnueabihf, use-cross: true }
- { os: ubuntu-22.04, target: aarch64-unknown-linux-gnu, use-cross: true }
- { os: ubuntu-22.04, target: i586-unknown-linux-gnu, use-cross: true }
- { os: ubuntu-22.04, target: i686-unknown-linux-gnu, use-cross: true }
- { os: ubuntu-22.04, target: i686-unknown-linux-musl, use-cross: true }
# MacOS 26
- { os: macos-26, target: aarch64-apple-darwin, use-cross: false }
# Windows 2025
- { os: windows-2025, target: i686-pc-windows-msvc, use-cross: false }
- { os: windows-2025, target: x86_64-pc-windows-gnu, use-cross: false }
- { os: windows-2025, target: x86_64-pc-windows-msvc, use-cross: false }
# Windows 2022
- { os: windows-2022, target: i686-pc-windows-msvc, use-cross: false }
- { os: windows-2022, target: x86_64-pc-windows-gnu, use-cross: false }
- { os: windows-2022, target: x86_64-pc-windows-msvc, use-cross: false }
runs-on: ${{ matrix.job.os }}
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: ${{ matrix.job.target }}
- uses: taiki-e/install-action@cross
if: matrix.job.use-cross
- name: "example 'readme'"
if: matrix.job.use-cross
env:
SIMPLE_VAR_1: "'test value' in environment variable"
run: cross run --target ${{ matrix.job.target }} --example=readme -- "'test value' on command line" "two" "three"
- name: "example 'readme'"
if: ${{ !matrix.job.use-cross }}
env:
SIMPLE_VAR_1: "'test value' in environment variable"
run: cargo run --target ${{ matrix.job.target }} --example=readme -- "'test value' on command line" "two" "three"
- name: "example 'simple'"
if: matrix.job.use-cross
env:
SIMPLE_VAR_1: "'test value' in environment variable"
run: cross run --target ${{ matrix.job.target }} --example=simple -- "'test value' on command line" "two" "three"
- name: "example 'simple'"
if: ${{ !matrix.job.use-cross }}
env:
SIMPLE_VAR_1: "'test value' in environment variable"
run: cargo run --target ${{ matrix.job.target }} --example=simple -- "'test value' on command line" "two" "three"
- name: "example 'custom_collector'"
if: matrix.job.use-cross
run: cross run --target ${{ matrix.job.target }} --example=custom_collector -- "'test value' on command line" "two" "three"
- name: "example 'custom_collector'"
if: ${{ !matrix.job.use-cross }}
run: cargo run --target ${{ matrix.job.target }} --example=custom_collector -- "'test value' on command line" "two" "three"
- name: "test-crates tests"
run: ./test-crates/run-all-tests.sh
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.85.0
components: rustfmt
- name: "cargo fmt"
run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.85.0
components: clippy
- name: "cargo clippy"
run: cargo clippy -- -D warnings