From bf05b759eb596204f3095a89feff07de4fc7a563 Mon Sep 17 00:00:00 2001 From: Anthony Caccia Date: Mon, 14 Aug 2023 15:46:11 +0200 Subject: [PATCH 1/4] ci: add workflows on PR to main and push to main to check for test, fmt and clippy --- .github/workflows/ci.yaml | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..adb1d02e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,58 @@ +on: + push: + branches: [main] + pull_request: + branches: [main] + +name: Continuous integration + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test Suite + 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 + args: --workspace + + 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: --workspace -- -D warnings \ No newline at end of file From c6b7bd45221ed58dc647970ff6f18a1c9dcc0d94 Mon Sep 17 00:00:00 2001 From: Anthony Caccia Date: Mon, 14 Aug 2023 16:10:43 +0200 Subject: [PATCH 2/4] ci: add audit for new dependencies --- .github/workflows/audit-on-new-deps.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/audit-on-new-deps.yaml diff --git a/.github/workflows/audit-on-new-deps.yaml b/.github/workflows/audit-on-new-deps.yaml new file mode 100644 index 00000000..bae8a36f --- /dev/null +++ b/.github/workflows/audit-on-new-deps.yaml @@ -0,0 +1,14 @@ +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 }} \ No newline at end of file From be32831eaa521c870f3dbb238461c2bfd56c73d1 Mon Sep 17 00:00:00 2001 From: Anthony Caccia Date: Mon, 14 Aug 2023 16:11:01 +0200 Subject: [PATCH 3/4] ci: add daily checks for auditing dependencies --- .github/workflows/daily-checks.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/daily-checks.yaml diff --git a/.github/workflows/daily-checks.yaml b/.github/workflows/daily-checks.yaml new file mode 100644 index 00000000..b4a0d1b0 --- /dev/null +++ b/.github/workflows/daily-checks.yaml @@ -0,0 +1,14 @@ +name: Daily checks + +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 }} \ No newline at end of file From 7e37369c727b6273f32828d318d48eb327a3850b Mon Sep 17 00:00:00 2001 From: Anthony Caccia Date: Mon, 14 Aug 2023 16:53:55 +0200 Subject: [PATCH 4/4] ci: add daily check for clippy, in case of new warnings with a toolchain update --- .github/workflows/daily-checks.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/daily-checks.yaml b/.github/workflows/daily-checks.yaml index b4a0d1b0..7189036e 100644 --- a/.github/workflows/daily-checks.yaml +++ b/.github/workflows/daily-checks.yaml @@ -11,4 +11,14 @@ jobs: - uses: actions/checkout@v1 - uses: actions-rs/audit-check@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} + + clippy-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: rustup component add clippy + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features \ No newline at end of file