-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (77 loc) · 2.43 KB
/
format.yml
File metadata and controls
77 lines (77 loc) · 2.43 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
name: "Formatting"
on:
# schedule:
# - cron: "0 0 * * *"
push:
branches:
- master
- main
env:
# 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:
format-lint:
name: "Formatting - format-lint"
strategy:
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: "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: "Build project"
run: cargo build --release --all