diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5e3e694 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,77 @@ +name: Continuous Integration + +on: + push: + branches: + - main + pull_request: + branches: + - main + schedule: + - cron: "0 0 * * 0" + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + with: + components: clippy,rustfmt + - uses: actions/checkout@v4 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + - name: Check lints + run: cargo clippy -- -D warnings + - name: Check formatting + run: cargo fmt --all -- --check + + check-docs: + name: Check docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-rdme + uses: taiki-e/install-action@v2 + with: + tool: cargo-rdme + - name: Check README.md is up-to-date + run: cargo rdme --check + + coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@v2 + with: + tool: cargo-llvm-cov + - name: Generate coverage + run: cargo llvm-cov --lcov --output-path target/lcov.info + - name: Upload to codecov.io + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + + audit: + name: Perform audit for security + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + - name: Run cargo-audit + uses: actions-rs/audit-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }}