-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (74 loc) · 2.43 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
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
name: CI
on:
push:
# Run on the main branch
branches:
- main
- release/*
# Also on PRs, just be careful not to publish anything
pull_request:
# Allow to be called from other workflows (like "release")
workflow_call:
# But don't trigger on tags, as they are covered by the "release.yaml" workflow
jobs:
fmt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: webiny/action-conventional-commits@8bc41ff4e7d423d56fa4905f6ff79209a78776c7
- name: Check formatting
run: |
cargo fmt --check
test:
strategy:
matrix:
rust:
- stable
- "1.74" # MSRV
os:
- ubuntu-latest
- windows-latest
- macos-latest
include:
- os: ubuntu-latest
install: |
sudo apt install -y libssl-dev
- os: windows-latest
install: |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
vcpkg install openssl:x64-windows-static-md
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
if: runner.os == 'Windows'
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite');
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-check-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }}
- name: Disable rustup auto update
run: |
rustup set auto-self-update disable
- name: Install Rust ${{ matrix.rust }}
run: |
rustup install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- name: Install dependencies
run: ${{ matrix.install }}
- name: Check
run: cargo check --workspace ${{ matrix.args }}
- name: Test
run: cargo test --workspace ${{ matrix.args }} -- --nocapture