diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..567c3fd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +--- +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index fb3ac92..6bd0b68 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,14 +1,18 @@ +--- name: Security audit -on: + +'on': push: pull_request: schedule: - cron: "43 04 * * *" + jobs: security_audit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/audit-check@v1 + - uses: actions/checkout@v4 + + - uses: rustsec/audit-check@v1.4.1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75676f2..53cc5e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ +--- name: CI -on: [push, pull_request] +'on': [push, pull_request] + +env: + toolchain: nightly-2022-11-03 jobs: clippy: @@ -8,68 +12,69 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "true" + - name: toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly-2022-11-03 - profile: minimal + toolchain: ${{ env.toolchain }} components: rustfmt, clippy - override: true - - uses: Swatinem/rust-cache@v1 + + - name: Cache rust dependencies + uses: Swatinem/rust-cache@v2 + - name: cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - name: install cargo lints - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-lints - - name: cargo lints clippy - uses: actions-rs/cargo@v1 - with: - command: lints - args: clippy + run: | + cargo +${{ env.toolchain }} fmt --all -- --check + + - name: Install cargo-lints + run: | + cargo install cargo-lints + + - name: Clippy check (with lints) + run: | + cargo lints clippy --all-targets --all-features + build: name: build runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "true" + - name: toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - - uses: Swatinem/rust-cache@v1 + + - name: Cache rust dependencies + uses: Swatinem/rust-cache@v2 + - name: cargo build - uses: actions-rs/cargo@v1 - with: - command: build - args: --release + run: | + cargo build --release + test: name: test runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "true" + - name: toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: stable - profile: minimal - override: true - - uses: Swatinem/rust-cache@v1 + + - name: Cache rust dependencies + uses: Swatinem/rust-cache@v2 + - name: cargo test - uses: actions-rs/cargo@v1 - with: - command: test + run: | + cargo test diff --git a/.github/workflows/cov.yml b/.github/workflows/cov.yml index dc4865b..c55c46c 100644 --- a/.github/workflows/cov.yml +++ b/.github/workflows/cov.yml @@ -1,39 +1,48 @@ +--- name: Coverage -on: + +'on': push: branches: - development - cov-* + env: RUSTUP_TOOLCHAIN: "nightly" + jobs: coverage: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "true" + - name: Install dependencies run: | sudo apt update - sudo apt install -y jq lcov - - name: Download Rust - uses: actions-rs/toolchain@v1 + sudo apt install --no-install-recommends --assume-yes \ + jq lcov + + - name: toolchain + uses: dtolnay/rust-toolchain@nightly with: toolchain: nightly - override: true components: llvm-tools-preview + - name: Install requirements for code coverage run: | cargo install cargo-binutils cargo install rustfilt + - name: Run test coverage id: coverage env: SKIP_HTML: "1" run: | /bin/bash -c ./code_coverage.sh + - name: Coveralls upload uses: coverallsapp/github-action@master with: diff --git a/.github/workflows/pr_title.yml b/.github/workflows/pr_title.yml index dd7905d..ebd6666 100644 --- a/.github/workflows/pr_title.yml +++ b/.github/workflows/pr_title.yml @@ -1,5 +1,7 @@ +--- name: PR -on: + +'on': pull_request: types: - opened @@ -15,6 +17,9 @@ jobs: run: | npm install -g @commitlint/cli @commitlint/config-conventional echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js + - name: lint + env: + PR_TITLE: ${{github.event.pull_request.title}} run: | - echo "${{github.event.pull_request.title}}" | commitlint + echo "$PR_TITLE" | commitlint