-
Notifications
You must be signed in to change notification settings - Fork 66
140 lines (112 loc) · 3.31 KB
/
build.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
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
name: build
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
RUSTFLAGS: "-D warnings"
RUST_BACKTRACE: short
NEXTEST_PROFILE: ci
CI: 1
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
build:
runs-on: ubuntu-latest
if: |
${{ github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name !=
github.event.pull_request.base.repo.full_name }}
steps:
- uses: actions/checkout@v4
- name: Remove rust-toolchain.toml
shell: bash
run: |
# so we don't add tooling for all targets
rm rust-toolchain.toml
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- uses: pnpm/action-setup@v4
with:
version: latest
- name: Build crux
shell: bash
run: cargo build --workspace
- name: Install nextest
shell: bash
run: |
set -euxo pipefail
curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Run tests
shell: bash
run: |
./scripts/test.sh
find-examples:
runs-on: ubuntu-latest
if: |
${{ github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name !=
github.event.pull_request.base.repo.full_name }}
outputs:
examples: ${{ steps.find.outputs.examples }}
steps:
- uses: actions/checkout@v4
- id: find
run: |
EXAMPLES=$(ls -d examples/*/ | xargs -L 1 basename | jq --raw-input --slurp --compact-output 'split("\n")[:-1]')
echo "examples=$EXAMPLES" >> $GITHUB_OUTPUT
examples:
runs-on: ubuntu-latest
container: ivangabriele/tauri:debian-bookworm-18
if: |
${{ github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name !=
github.event.pull_request.base.repo.full_name }}
needs: find-examples
strategy:
matrix:
example: ${{ fromJson(needs.find-examples.outputs.examples) }}
defaults:
run:
working-directory: examples/${{ matrix.example }}
steps:
- uses: actions/checkout@v4
- name: Remove rust-toolchain.toml
shell: bash
run: |
# so we don't add tooling for all targets
rm ../../rust-toolchain.toml
- name: Install rustfmt
shell: bash
run: rustup component add rustfmt
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: Install nextest
shell: bash
run: |
set -euxo pipefail
curl -LsSf https://get.nexte.st/0.9/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Check formatting
shell: bash
run: cargo fmt --all --check
- name: Build ${{ matrix.example }}
shell: bash
run: cargo build
- name: Run tests
shell: bash
run: |
cargo nextest run --all-features
- name: Build & run doctests
shell: bash
run: |
cargo test --doc --no-fail-fast