Automatically building via GitHub actions #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
rust-check: | |
name: Rust Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Check fmt | |
run: rustup component add rustfmt && cargo fmt --check | |
bclean-cli: | |
name: bclean cli (${{ matrix.build }}) | |
needs: [rust-check] | |
strategy: | |
matrix: | |
build: [linux, windows] | |
include: | |
- build: linux | |
os: ubuntu-20.04 | |
target: bclean-cli | |
- build: windows | |
os: windows-latest | |
target: bclean-cli.exe | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Build | |
run: cargo build --verbose --release | |
- uses: actions/upload-artifact@v3 | |
name: Upload bclean tool | |
with: | |
name: ${{ matrix.build }} | |
path: target/release/${{ matrix.target }} |