Skip to content

Commit

Permalink
Chapter 2
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony M. Bonafide <anthony.bonafide@shipt.com>
  • Loading branch information
AnthonyMBonafide committed Mar 19, 2024
1 parent 58309c1 commit e57defe
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Audit Dependencies"
on:
push:
paths:
# Run if workflow changes
- ".github/workflows/audit.yml"
# Run on changed dependencies
- "**/Cargo.toml"
- "**/Cargo.lock"
# Run if the configuration file changes
- "**/audit.toml"
# Rerun periodicly to pick up new advisories
schedule:
- cron: "0 0 * * *"
# Run manually
workflow_dispatch:

jobs:
audit:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/audit@v1
name: Audit Rust Dependencies
# with:
# # Comma separated list of issues to ignore
# ignore: RUSTSEC-2020-0036
118 changes: 118 additions & 0 deletions .github/workflows/msrv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/msrv.md

on: [push, pull_request]

name: MSRV

jobs:
check:
name: Check
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.76.0
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check

test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.76.0
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: "0.15.0"
args: "-- --test-threads 1"

- name: Upload to codecov.io
uses: codecov/codecov-action@v1.0.2
with:
token: ${{secrets.CODECOV_TOKEN}}

- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml

fmt:
name: Rustfmt
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.76.0
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Install rustfmt
run: rustup component add rustfmt

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.76.0
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Install clippy
run: rustup component add clippy

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

0 comments on commit e57defe

Please sign in to comment.