-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (52 loc) · 1.55 KB
/
ci.yaml
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
name: ci
on:
schedule:
# * is a special character in YAML so you have to quote this string
# The final 1 indicates that we want to run this test on Tuesdays, making
# this a weekly test.
- cron: '30 2 * * 1'
workflow_dispatch:
pull_request:
push:
branches: main
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.runs-on }}-latest
strategy:
matrix:
runs-on: [ubuntu, windows]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rustup on Windows
if: matrix.runs-on == 'windows'
run: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
.\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
del rustup-init.exe
- name: Set Rust version to nightly
run: rustup default nightly
- name: Add Windows target
if: matrix.runs-on == 'windows'
run: |
rustc -Vv
cargo -V
rustup target add x86_64-pc-windows-msvc
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build workspace
run: cargo build --workspace --tests
- name: Run tests
run: cargo test --tests