# This runs `cargo audit` on everything.

name: Audit

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Cache
      uses: actions/cache@v3.2.3
      with:
        path: |
          ~/.cargo
          target
        key: audit
    - uses: actions/checkout@v3
      with:
        submodules: recursive
    - name: Install dependencies
      run: |
        cargo install cargo-audit
    - name: Audit
      run: cargo audit
