-
Notifications
You must be signed in to change notification settings - Fork 2
114 lines (99 loc) · 3.69 KB
/
_code.yml
File metadata and controls
114 lines (99 loc) · 3.69 KB
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
on:
workflow_call:
defaults:
run:
shell: bash
env:
RUSTDOCFLAGS: "-D warnings"
jobs:
plan:
name: Plan the execution
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Compute matrix
uses: ./.github/actions/plan
id: set-matrix
with:
plan-name: code
test:
needs:
- plan
strategy:
matrix: ${{ fromJson(needs.plan.outputs.matrix) }}
fail-fast: false
name: |-
${{ matrix.plan.mode.platformIndependent == true && matrix.plan.mode.name || format('{1} @ {0}', matrix.plan.platform.name, matrix.plan.mode.name) }}
runs-on: ${{ matrix.plan.platform.os }}
env: ${{ matrix.plan.platform.env }}
timeout-minutes: 50
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
timeout-minutes: 5
- uses: ./.github/actions/common-setup
with:
platformCacheKey: ${{ matrix.plan.platform.cacheKey }}
modeCacheKey: ${{ matrix.plan.mode.cargoCacheKey }}
buildEnvScript: ${{ matrix.plan.platform.buildEnvScript }}
extraRustTargetsToInstall: ${{ join(matrix.plan.platform.extraTargetsToInstall, ' ') }}
timeout-minutes: 10
- name: Run cargo ${{ matrix.plan.mode.cargoCommand }}
run: cargo ${{ matrix.plan.mode.cargoCommand }} ${{ matrix.plan.mode.cargoArgs }} ${{ matrix.plan.mode.passZigbuildTarget && matrix.plan.platform.buildTarget && format('--target={0}', matrix.plan.platform.buildTarget) || '' }}
downloadable-utils:
strategy:
matrix:
util:
- name: cargo deny
download: >
curl -sSL "https://github.com/EmbarkStudios/cargo-deny/releases/download/0.19.0/cargo-deny-0.19.0-x86_64-unknown-linux-musl.tar.gz" |
sudo tar -xzvf - -C /usr/local/bin --strip-components=1
run: cargo-deny check --hide-inclusion-graph --show-stats
requiresRust: true
- name: taplo
download: >
curl -sSL "https://github.com/tamasfe/taplo/releases/download/0.10.0/taplo-linux-x86_64.gz" |
zcat > /usr/local/bin/taplo \
&& chmod +x /usr/local/bin/taplo
run: taplo format --check
- name: cargo sort
download: >
curl -sSL "https://github.com/DevinR528/cargo-sort/releases/download/v2.0.2/cargo-sort-x86_64-unknown-linux-gnu.tar.gz" |
sudo tar -xzvf - -C /usr/local/bin
run: cargo-sort -cwg
- name: cargo shear
download: >
curl -sSL "https://github.com/Boshen/cargo-shear/releases/download/v1.9.1/cargo-shear-x86_64-unknown-linux-gnu.tar.gz" |
sudo tar -xzvf - -C /usr/local/bin
run: cargo-shear
- name: typos
download: >
curl -sSL "https://github.com/crate-ci/typos/releases/download/v1.42.0/typos-v1.42.0-x86_64-unknown-linux-musl.tar.gz" |
sudo tar -xzvf - -C /usr/local/bin
run: typos
fail-fast: false
name: ${{ matrix.util.name }}
runs-on: ubuntu-24.04
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
timeout-minutes: 5
- uses: ./.github/actions/common-setup
with:
requiresRust: ${{ matrix.util.requiresRust }}
timeout-minutes: 10
- name: Download ${{ matrix.util.name }}
run: ${{ matrix.util.download }}
timeout-minutes: 10
- run: ${{ matrix.util.run }}
timeout-minutes: 10