-
Notifications
You must be signed in to change notification settings - Fork 18
174 lines (146 loc) · 4.32 KB
/
rust.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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
name: rust
on:
push:
branches:
- main
- dev
- 'hacl-star-**'
paths-ignore:
- .gitignore
- CLA.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- cpu-features.md
- LICENSE
- LICENSE-APACHE
- README.md
pull_request:
# Can't use an YAML anchor because "Anchors are not currently supported." (GitHub 12/07/2022)
paths-ignore:
- .gitignore
- CLA.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- cpu-features.md
- LICENSE
- LICENSE-APACHE
- README.md
workflow_dispatch:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
mach:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
# - ubuntu-latest Disabling Ubuntu for now as long as bindgen is broken
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo
- if: matrix.os == 'macos-latest'
run: brew install ninja
- if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install ninja-build
- if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d
- if: matrix.os == 'windows-latest'
run: choco install ninja
- name: Cargo update
working-directory: rust
run: cargo update
- name: Debug Build
run: ./mach build -l rust -v
- name: Release Build
run: ./mach build --release -l rust -v
- name: Test Debug
# FIXME: enable Windows tests
if: matrix.os != 'windows-latest'
run: cargo test --manifest-path rust/Cargo.toml
env:
MACH_BUILD: 1
standalone:
strategy:
fail-fast: false
matrix:
bits: [32, 64]
os:
- macos-latest
# - ubuntu-latest disable for now
- windows-latest
exclude:
- bits: 32
os: "macos-latest"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo
- if: matrix.os == 'macos-latest'
run: brew install ninja
- if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install ninja-build gcc-multilib g++-multilib clang-15
rustup target add i686-unknown-linux-gnu
- name: Setup | Developer Command Prompt (x86)
if: ${{ matrix.bits == 32 && matrix.os == 'windows-latest' }}
uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d
with:
arch: x86
- name: Setup | Developer Command Prompt (x64)
if: ${{ matrix.bits == 64 && matrix.os == 'windows-latest' }}
uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d
with:
arch: x64
- if: matrix.os == 'windows-latest'
run: |
choco install ninja
rustup target add i686-pc-windows-msvc
- name: Cargo update
working-directory: rust
run: cargo update
- name: Debug Build
if: matrix.bits == 64
working-directory: rust
run: cargo build -v
- name: Release Build
if: matrix.bits == 64
working-directory: rust
run: cargo build --release -v
- name: Test Debug
if: matrix.bits == 64
working-directory: rust
run: cargo test -v
- name: Test Debug 32-bit
if: ${{ matrix.bits == 32 && matrix.os == 'ubuntu-latest' }}
working-directory: rust
run: cargo test -v --target i686-unknown-linux-gnu
- name: Test Debug 32-bit
if: ${{ matrix.bits == 32 && matrix.os == 'windows-latest' }}
working-directory: rust
run: |
../tools/vcbuild.cmd 32
cargo test -v --target i686-pc-windows-msvc