-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (96 loc) · 3.32 KB
/
ci.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
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
# Always run main branch builds to completion.
fail-fast: ${{ github.event_name == 'pull_request' ||
(github.ref != 'refs/heads/main' &&
!startsWith(github.ref, 'refs/tags/')) }}
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Configure git
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
git config --global fetch.parallel 32
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run sccache-cache
if: github.repository == 'YoloDev/rkyv-utils'
uses: mozilla-actions/sccache-action@v0.0.6
- name: Configure sccache
if: github.repository == 'YoloDev/rkyv-utils'
shell: bash
run: |
if [[ -z "${{ secrets.SCCACHE_ENDPOINT }}" ]]; then
echo "SCCACHE_ENDPOINT is not set"
else
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
echo "SCCACHE_BUCKET=$SCCACHE_BUCKET" >> $GITHUB_ENV
echo "SCCACHE_REGION=$SCCACHE_REGION" >> $GITHUB_ENV
echo "SCCACHE_ENDPOINT=$SCCACHE_ENDPOINT" >> $GITHUB_ENV
echo "AWS_ACCESS_KEY_ID=$SCCACHE_ACCESS_KEY_ID" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=$SCCACHE_SECRET_ACCESS_KEY" >> $GITHUB_ENV
fi
env:
SCCACHE_BUCKET: ${{ vars.SCCACHE_BUCKET }}
SCCACHE_REGION: ${{ vars.SCCACHE_REGION }}
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }}
SCCACHE_ACCESS_KEY_ID: ${{ secrets.SCCACHE_ACCESS_KEY_ID }}
SCCACHE_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_SECRET_ACCESS_KEY }}
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v0
save-if: ${{ github.ref == 'refs/heads/main' }}
# cache-provider: buildjet
- name: Install cargo-featurex
run: cargo install cargo-featurex
- name: Run check (all feature permutations)
run: cargo featurex clippy
- name: Run tests (all feature permutations)
run: cargo featurex test
miri-test:
name: Miri Test
runs-on: ${{ matrix.os }}
strategy:
# Always run main branch builds to completion.
fail-fast: ${{ github.event_name == 'pull_request' ||
(github.ref != 'refs/heads/main' &&
!startsWith(github.ref, 'refs/tags/')) }}
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Configure git
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
git config --global fetch.parallel 32
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v0
save-if: ${{ github.ref == 'refs/heads/main' }}
# cache-provider: buildjet
- uses: extractions/setup-just@v2
name: Setup just
- name: Run tests
run: just miri-test