Skip to content

build: extract common steps; add cache to github actions #14

build: extract common steps; add cache to github actions

build: extract common steps; add cache to github actions #14

Workflow file for this run

name: Rust

Check failure on line 1 in .github/workflows/rust.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/rust.yml

Invalid workflow file

You have an error in your yaml syntax
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- <<: *common-steps
- name: Run build
run: cargo build --verbose
test:
runs-on: ubuntu-latest
steps:
- <<: *common-steps
- name: Run tests
run: cargo test --verbose
format:
runs-on: ubuntu-latest
steps:
- <<: *common-steps
- name: Run format check
run: cargo fmt --check
clippy:
runs-on: ubuntu-latest
steps:
- <<: *common-steps
- name: Run clippy
run: cargo clippy
common-steps: &common-steps
- uses: actions/checkout@v3
- name: Cache setup
uses: Swatinem/rust-cache@v2