Include mentions in active formatting (#150) #707
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: Build Rust crates | |
on: | |
push: | |
branches: ["**"] | |
paths-ignore: | |
- "fiberplane-charts" | |
- "fiberplane-prometheus-query" | |
- "fiberplane-ui" | |
release: | |
types: [published] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: setup-git-credentials | |
uses: de-vri-es/setup-git-credentials@v2 | |
with: | |
credentials: "https://fiberplanebot:${{ secrets.PRIVATE_GITHUB_TOKEN }}@github.com/" | |
- name: Cache Rust dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo- | |
- name: Install latest stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Check format | |
# Skip formatting on main, since it's not critical and should've already | |
# been checked before merging | |
if: ${{ github.event_name == 'push' && github.ref != 'refs/heads/main' }} | |
run: cargo fmt -- --check | |
- name: Lint code | |
# Skip linting on main, since it's not critical and should've already | |
# been checked before merging | |
if: ${{ github.event_name == 'push' && github.ref != 'refs/heads/main' }} | |
uses: giraffate/clippy-action@v1 | |
with: | |
filter_mode: nofilter | |
fail_on_error: true | |
clippy_flags: --all-features --no-deps | |
--workspace | |
--exclude fiberplane-api-client | |
--exclude fiberplane-provider-bindings | |
--exclude fiberplane-provider-runtime | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Cargo login | |
if: ${{ github.event_name == 'release' }} | |
uses: actions-rs/cargo@v1 | |
with: | |
command: login | |
args: ${{ secrets.CRATES_TOKEN }} | |
- name: Publish crates | |
if: ${{ github.event_name == 'release' }} | |
run: cargo xtask publish |