| 1 | name: Build |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - master |
| 7 | tags: |
| 8 | - "*" |
| 9 | pull_request: |
| 10 | branches: |
| 11 | - master |
| 12 | |
| 13 | defaults: |
| 14 | run: |
| 15 | shell: bash |
| 16 | |
| 17 | env: |
| 18 | CACHE_KEY: 1 |
| 19 | |
| 20 | jobs: |
| 21 | all: |
| 22 | name: All |
| 23 | |
| 24 | runs-on: ubuntu-latest |
| 25 | |
| 26 | env: |
| 27 | RUSTFLAGS: "--deny warnings" |
| 28 | |
| 29 | steps: |
| 30 | - uses: actions/checkout@v2 |
| 31 | |
| 32 | - uses: actions/cache@v2 |
| 33 | with: |
| 34 | path: | |
| 35 | ~/.cargo/bin/ |
| 36 | ~/.cargo/registry/index/ |
| 37 | ~/.cargo/registry/cache/ |
| 38 | ~/.cargo/git/db/ |
| 39 | target/ |
| 40 | key: cargo-${{ env.CACHE_KEY }}-${{ hashFiles('**/Cargo.lock') }} |
| 41 | |
| 42 | - name: Install clippy and rustfmt |
| 43 | run: rustup component add clippy rustfmt |
| 44 | |
| 45 | - name: Info |
| 46 | run: | |
| 47 | rustup --version |
| 48 | cargo --version |
| 49 | cargo clippy --version |
| 50 | cargo fmt --version |
| 51 | |
| 52 | - name: Check |
| 53 | run: cargo check |
| 54 | |
| 55 | - name: Test |
| 56 | run: cargo test |
| 57 | |
| 58 | - name: Format |
| 59 | run: cargo fmt -- --check |
| 60 | |
| 61 | - name: Lint |
| 62 | run: cargo clippy |