-
Notifications
You must be signed in to change notification settings - Fork 129
161 lines (150 loc) · 5.2 KB
/
rust.yml
File metadata and controls
161 lines (150 loc) · 5.2 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
160
161
name: Rust
on:
push:
branches: [main, release/**]
pull_request:
concurrency:
group:
${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha ||
github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
complete:
if: always()
needs:
[
cargo-deny,
check,
build-and-test,
build-and-test-macos,
build-and-test-windows,
publish-dry-run,
]
runs-on: ubuntu-slim
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
cargo-deny:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check: [advisories, bans, licenses, sources]
continue-on-error: ${{ matrix.check == 'advisories' }}
steps:
- uses: actions/checkout@v6
- uses: EmbarkStudios/cargo-deny-action@91bf2b620e09e18d6eb78b92e7861937469acedb
with:
command: check ${{ matrix.check }}
check:
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v6
- uses: stellar/actions/rust-cache@main
- run: sudo apt update && sudo apt install -y libudev-dev libdbus-1-dev
- run: rustup update
- run: npm install
- run: make build-test-wasms
- run: make check
build-and-test:
strategy:
fail-fast: false
matrix:
rust: [msrv, latest]
sys:
- os: ubuntu-latest-8-cores
target: x86_64-unknown-linux-gnu
- os: ubuntu-jammy-8-cores-arm64
target: aarch64-unknown-linux-gnu
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/build-and-test
with:
target: ${{ matrix.sys.target }}
rust-version: ${{ matrix.rust }}
build-and-test-macos:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.head_ref, 'release/')
strategy:
fail-fast: false
matrix:
rust: [msrv, latest]
sys:
- os: macos-15-intel
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/build-and-test
with:
target: ${{ matrix.sys.target }}
rust-version: ${{ matrix.rust }}
build-and-test-windows:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.head_ref, 'release/')
strategy:
fail-fast: false
matrix:
rust: [msrv, latest]
sys:
- os: windows-latest-8-cores
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/build-and-test
with:
target: ${{ matrix.sys.target }}
rust-version: ${{ matrix.rust }}
publish-dry-run:
if: github.event_name == 'push' || startsWith(github.head_ref, 'release/')
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest-8-cores
target: x86_64-unknown-linux-gnu
cargo-hack-feature-options:
--feature-powerset --skip emulator-tests
additional-deb-packages: libudev-dev libdbus-1-dev
# - os: ubuntu-jammy-8-cores-arm64
# target: aarch64-unknown-linux-gnu
# cargo-hack-feature-options: --feature-powerset --skip emulator-tests default
# additional-deb-packages: libudev-dev libssl-dev libdbus-1-dev
- os: macos-15-intel
target: x86_64-apple-darwin
cargo-hack-feature-options:
--feature-powerset --skip emulator-tests
- os: macos-latest
target: aarch64-apple-darwin
cargo-hack-feature-options:
--feature-powerset --skip emulator-tests
# Windows builds notes:
#
# The different features that need testing are split over unique
# isolated builds for Windows, because there's a bug in Cargo [1] that
# causes builds of wasm-opt [2] to fail when run one after the other and
# attempting to clean up artifacts in between. The bug has been fixed,
# but will not make it into a stable release of Cargo until ~August
# 2023.
#
# [1]: https://github.com/rust-lang/cargo/pull/11442
# [2]: https://github.com/brson/wasm-opt-rs/issues/116
- os: windows-latest-8-cores
target: x86_64-pc-windows-msvc
cargo-hack-feature-options: ""
cargo-hack-package-options: --no-default-features
- os: windows-latest-8-cores
target: x86_64-pc-windows-msvc
cargo-hack-feature-options:
--features additional-libs --ignore-unknown-features
uses: stellar/actions/.github/workflows/rust-publish-dry-run-v2.yml@main
with:
runs-on: ${{ matrix.os }}
target: ${{ matrix.target }}
cargo-hack-feature-options: ${{ matrix.cargo-hack-feature-options }}
additional-deb-packages: ${{ matrix.additional-deb-packages }}