diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml new file mode 100644 index 0000000..751df93 --- /dev/null +++ b/.github/workflows/fmt.yml @@ -0,0 +1,28 @@ +permissions: + contents: read + +on: + workflow_call: + +env: + CARGO_INCREMENTAL: 0 + CARGO_NET_GIT_FETCH_WITH_CLI: true + CARGO_NET_RETRY: 10 + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + RUSTFLAGS: -D warnings + RUSTDOCFLAGS: -D warnings + RUSTUP_MAX_RETRIES: 10 + +defaults: + run: + shell: bash + +jobs: + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + run: rustup update stable + - run: cargo fmt --all --check diff --git a/.github/workflows/security_audit.yml b/.github/workflows/security_audit.yml new file mode 100644 index 0000000..6fd41d8 --- /dev/null +++ b/.github/workflows/security_audit.yml @@ -0,0 +1,41 @@ +permissions: + contents: read + +on: + workflow_call: + secrets: + GITHUB_TOKEN: + required: true + +env: + CARGO_INCREMENTAL: 0 + CARGO_NET_GIT_FETCH_WITH_CLI: true + CARGO_NET_RETRY: 10 + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + RUSTFLAGS: -D warnings + RUSTDOCFLAGS: -D warnings + RUSTUP_MAX_RETRIES: 10 + +defaults: + run: + shell: bash + +jobs: + security_audit: + permissions: + checks: write + contents: read + issues: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + run: rustup update stable + # rustsec/audit-check used to do this automatically + - name: Generate Cargo.lock + run: cargo generate-lockfile + # https://github.com/rustsec/audit-check/issues/2 + - uses: rustsec/audit-check@v2.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }}