Skip to content

Formatting

Formatting #18

Workflow file for this run

name: "Formatting"
on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- master
- main
env:
SCCACHE_GHA_ENABLED: true
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
PROJECT_NAME: REPLACE_NAME_HERE
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
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: "Checkout sources"
uses: actions/checkout@master
- name: "Cache Cargo dependencies"
uses: Swatinem/rust-cache@v2
- name: "Setup sccache"
uses: mozilla-actions/[email protected]
- 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