-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (145 loc) · 5.1 KB
/
build.yml
File metadata and controls
145 lines (145 loc) · 5.1 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
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
141
142
143
144
145
name: "Build - Check & Clippy"
on:
push:
branches:
- master
- main
env:
preview: ${{ github.event_name == 'release' && contains(github.event.release.tag_name, 'preview') }}
on_schedule: "false"
# RUSTC_WRAPPER: sccache
RUSTC_WRAPPER: sccache
CACHE_VERSION: v1
SCCACHE_VERSION: 0.10.0
SCCACHE_GHA_ENABLED: true
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
PROJECT_NAME: bulk_runner_rs
jobs:
check:
name: "Build - check"
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
gcc: gcc-x86-64-linux-gnu
rust: nightly
- os: windows-latest
target: x86_64-pc-windows-msvc
rust: nightly
runs-on: ${{ matrix.os }}
env:
RUSTC_WRAPPER: sccache
CACHE_VERSION: v1
SCCACHE_VERSION: 0.10.0
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: "Checkout sources"
uses: actions/checkout@master
- name: "Setup sccache"
uses: mozilla-actions/sccache-action@v0.0.9
- name: "Install cargo tools"
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall,cargo-make,just,taplo
- name: "Cache Cargo dependencies"
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/sccache/
~/.rustup/
target/
restore-keys: |
${{ runner.os }}-${{ github.workflow }}-${{ env.CACHE_VERSION }}-${{ github.job }}-
${{ runner.os }}-${{ github.workflow }}-${{ env.CACHE_VERSION }}
# - name: "Setup sccache"
# uses: mozilla-actions/sccache-action@v0.0.9
- name: "Install gcc"
if: matrix.gcc != ''
run: sudo apt update && sudo apt install -yq ${{ matrix.gcc }}
# - name: "Install cargo-binstall"
# uses: cargo-bins/cargo-binstall@main
- name: "Setup Rust toolchain"
run: rustup toolchain install nightly --profile default --target ${{ matrix.target }} --no-self-update
- name: "Ensure nightly rustfmt installed"
run: rustup component add rustfmt --toolchain nightly
- name: "Run Cargo fmt"
run: cargo +nightly fmt --all
- name: "Run Cargo check"
run: cargo check
- name: "Run Clippy with pedantic"
run: cargo clippy --all-targets --all-features -- -W clippy::pedantic
- name: "Build project"
run: cargo build --release --all
clippy:
name: "Build - clippy"
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
gcc: gcc-x86-64-linux-gnu
rust: nightly
- os: windows-latest
target: x86_64-pc-windows-msvc
rust: nightly
runs-on: ${{ matrix.os }}
env:
RUSTC_WRAPPER: sccache
CACHE_VERSION: v1
SCCACHE_VERSION: 0.10.0
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: "Checkout sources"
uses: actions/checkout@master
- name: "Setup sccache"
uses: mozilla-actions/sccache-action@v0.0.9
- name: "Cache Cargo dependencies"
uses: Swatinem/rust-cache@v2
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/sccache/
~/.rustup/
target/
restore-keys: |
${{ runner.os }}-${{ github.workflow }}-${{ env.CACHE_VERSION }}-${{ github.job }}-
${{ runner.os }}-${{ github.workflow }}-${{ env.CACHE_VERSION }}
# - name: "Setup sccache"
# uses: mozilla-actions/sccache-action@v0.0.9
# - name: "Setup sccache"
# uses: mozilla-actions/sccache-action@v0.0.9
- name: "Install gcc"
if: matrix.gcc != ''
run: sudo apt update && sudo apt install -yq ${{ matrix.gcc }}
- name: "Install cargo-binstall"
uses: cargo-bins/cargo-binstall@main
- name: "Install sccache via cargo-binstall"
run: cargo binstall -y sccache@${{ env.SCCACHE_VERSION }}
- name: "Setup Rust toolchain"
run: rustup toolchain install nightly --profile default --target ${{ matrix.target }} --no-self-update
- name: "Ensure nightly rustfmt installed"
run: rustup component add rustfmt --toolchain nightly
- name: "Run Cargo fmt"
run: cargo +nightly fmt --all
- name: "Run Clippy with pedantic"
run: cargo clippy --all-targets --all-features -- -W clippy::pedantic
- name: "Build project"
run: cargo build --release --all