From 811d070c0cd6f653cbe0e31bf3d35eadc5845fa6 Mon Sep 17 00:00:00 2001 From: David Rousselie Date: Mon, 10 Jan 2022 15:26:37 +0100 Subject: [PATCH] Setup Github actions --- .github/workflows/audit.yml | 16 ++++++++++ .github/workflows/ci.yml | 58 +++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/audit.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 0000000..f7302be --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,16 @@ +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 }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b5548fb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +on: [push] + +name: CI + +jobs: + format: + name: rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: rustfmt + override: true + - uses: LoliGothick/rustfmt-check@v0.2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + flags: --all + options: --manifest-path=Cargo.toml + + build_and_test: + name: contextswitch-api + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all-features + + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: -- -D warnings + + - 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