Skip to content

Instantly share code, notes, and snippets.

@LukeMathWalker
Last active November 22, 2025 17:14
Show Gist options
  • Select an option

  • Save LukeMathWalker/5ae1107432ce283310c3e601fac915f3 to your computer and use it in GitHub Desktop.

Select an option

Save LukeMathWalker/5ae1107432ce283310c3e601fac915f3 to your computer and use it in GitHub Desktop.

Revisions

  1. LukeMathWalker revised this gist Feb 23, 2023. 4 changed files with 37 additions and 63 deletions.
    14 changes: 0 additions & 14 deletions audit-on-push.yml
    Original file line number Diff line number Diff line change
    @@ -1,14 +0,0 @@
    name: Security audit
    on:
    push:
    paths:
    - '**/Cargo.toml'
    - '**/Cargo.lock'
    jobs:
    security_audit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/audit-check@v1
    with:
    token: ${{ secrets.GITHUB_TOKEN }}
    16 changes: 16 additions & 0 deletions audit.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    name: Security audit
    on:
    schedule:
    - cron: '0 0 * * *'
    push:
    paths:
    - '**/Cargo.toml'
    - '**/Cargo.lock'
    jobs:
    security_audit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: taiki-e/install-action@cargo-deny
    - name: Scan for vulnerabilities
    run: cargo deny check advisories
    58 changes: 21 additions & 37 deletions general.yml
    Original file line number Diff line number Diff line change
    @@ -10,60 +10,44 @@ jobs:
    name: Test
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions-rs/toolchain@v1
    with:
    profile: minimal
    toolchain: stable
    override: true
    - uses: actions-rs/cargo@v1
    with:
    command: test
    - uses: actions/checkout@v3
    - uses: dtolnay/rust-toolchain@stable
    - uses: Swatinem/rust-cache@v2
    - name: Run tests
    run: cargo test

    fmt:
    name: Rustfmt
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions-rs/toolchain@v1
    - uses: actions/checkout@v3
    - uses: dtolnay/rust-toolchain@stable
    with:
    toolchain: stable
    override: true
    components: rustfmt
    - uses: actions-rs/cargo@v1
    with:
    command: fmt
    args: --all -- --check
    - name: Enforce formatting
    run: cargo fmt --check

    clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions-rs/toolchain@v1
    - uses: actions/checkout@v3
    - uses: dtolnay/rust-toolchain@stable
    with:
    toolchain: stable
    override: true
    components: clippy
    - uses: actions-rs/clippy-check@v1
    with:
    token: ${{ secrets.GITHUB_TOKEN }}
    args: -- -D warnings
    - uses: Swatinem/rust-cache@v2
    - name: Linting
    run: cargo clippy -- -D warnings

    coverage:
    name: Code coverage
    runs-on: ubuntu-latest
    container:
    image: xd009642/tarpaulin
    options: --security-opt seccomp=unconfined
    steps:
    - name: Checkout repository
    uses: actions/checkout@v2

    - name: Install stable toolchain
    uses: actions-rs/toolchain@v1
    with:
    toolchain: stable
    override: true

    - name: Run cargo-tarpaulin
    uses: actions-rs/[email protected]
    with:
    args: '--ignore-tests'
    uses: actions/checkout@v3
    - name: Generate code coverage
    run: |
    cargo tarpaulin --verbose --workspace
    12 changes: 0 additions & 12 deletions scheduled-audit.yml
    Original file line number Diff line number Diff line change
    @@ -1,12 +0,0 @@
    name: Security audit
    on:
    schedule:
    - cron: '0 0 * * *'
    jobs:
    audit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/audit-check@v1
    with:
    token: ${{ secrets.GITHUB_TOKEN }}
  2. LukeMathWalker revised this gist Jan 23, 2021. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions general.yml
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,6 @@ jobs:
    - uses: actions/checkout@v2
    - uses: actions-rs/toolchain@v1
    with:
    profile: minimal
    toolchain: stable
    override: true
    components: rustfmt
    @@ -43,13 +42,12 @@ jobs:
    - uses: actions/checkout@v2
    - uses: actions-rs/toolchain@v1
    with:
    profile: minimal
    toolchain: stable
    override: true
    - run: rustup component add clippy
    - uses: actions-rs/cargo@v1
    components: clippy
    - uses: actions-rs/clippy-check@v1
    with:
    command: clippy
    token: ${{ secrets.GITHUB_TOKEN }}
    args: -- -D warnings

    coverage:
  3. LukeMathWalker revised this gist Jan 23, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion general.yml
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ jobs:
    profile: minimal
    toolchain: stable
    override: true
    - run: rustup component add rustfmt
    components: rustfmt
    - uses: actions-rs/cargo@v1
    with:
    command: fmt
  4. LukeMathWalker revised this gist Jun 6, 2020. 2 changed files with 72 additions and 11 deletions.
    8 changes: 5 additions & 3 deletions audit-on-push.yml
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,11 @@
    name: Security audit
    on:
    schedule:
    - cron: '0 0 * * *'
    push:
    paths:
    - '**/Cargo.toml'
    - '**/Cargo.lock'
    jobs:
    audit:
    security_audit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    75 changes: 67 additions & 8 deletions general.yml
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,71 @@
    name: Security audit
    on:
    schedule:
    - cron: '0 0 * * *'
    name: Rust

    on: [push, pull_request]

    env:
    CARGO_TERM_COLOR: always

    jobs:
    audit:
    test:
    name: Test
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/audit-check@v1
    - uses: actions/checkout@v2
    - uses: actions-rs/toolchain@v1
    with:
    token: ${{ secrets.GITHUB_TOKEN }}
    profile: minimal
    toolchain: stable
    override: true
    - uses: actions-rs/cargo@v1
    with:
    command: test

    fmt:
    name: Rustfmt
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions-rs/toolchain@v1
    with:
    profile: minimal
    toolchain: stable
    override: true
    - run: rustup component add rustfmt
    - uses: actions-rs/cargo@v1
    with:
    command: fmt
    args: --all -- --check

    clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions-rs/toolchain@v1
    with:
    profile: minimal
    toolchain: stable
    override: true
    - run: rustup component add clippy
    - uses: actions-rs/cargo@v1
    with:
    command: clippy
    args: -- -D warnings

    coverage:
    name: Code coverage
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
    uses: actions/checkout@v2

    - name: Install stable toolchain
    uses: actions-rs/toolchain@v1
    with:
    toolchain: stable
    override: true

    - name: Run cargo-tarpaulin
    uses: actions-rs/[email protected]
    with:
    args: '--ignore-tests'
  5. LukeMathWalker created this gist Jun 1, 2020.
    12 changes: 12 additions & 0 deletions audit-on-push.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    name: Security audit
    on:
    schedule:
    - cron: '0 0 * * *'
    jobs:
    audit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/audit-check@v1
    with:
    token: ${{ secrets.GITHUB_TOKEN }}
    12 changes: 12 additions & 0 deletions general.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    name: Security audit
    on:
    schedule:
    - cron: '0 0 * * *'
    jobs:
    audit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/audit-check@v1
    with:
    token: ${{ secrets.GITHUB_TOKEN }}
    12 changes: 12 additions & 0 deletions scheduled-audit.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    name: Security audit
    on:
    schedule:
    - cron: '0 0 * * *'
    jobs:
    audit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/audit-check@v1
    with:
    token: ${{ secrets.GITHUB_TOKEN }}