From 5b6be8e7f029bae6575c5ba8da3b5a50ba88f9c3 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 3 Dec 2023 16:39:11 -0500 Subject: [PATCH] add workflows from psqs --- .github/dependabot.yml | 10 +++++++ .github/workflows/check.yml | 59 +++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 30 +++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1557067 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + - package-ecosystem: cargo + directory: / + schedule: + interval: daily diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..f5e4c7a --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,59 @@ +# from https://github.com/jonhoo/rust-ci-conf +permissions: + contents: read +on: + push: + branches: [master] + pull_request: +name: check +jobs: + fmt: + runs-on: ubuntu-latest + name: nightly / fmt + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install stable + uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt + - name: cargo fmt --check --all + run: cargo fmt --check --all + clippy: + runs-on: ubuntu-latest + name: ${{ matrix.toolchain }} / clippy + permissions: + contents: read + checks: write + strategy: + fail-fast: false + matrix: + toolchain: [nightly] + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install ${{ matrix.toolchain }} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain }} + components: clippy + - name: cargo clippy + uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --workspace --all-targets -- -D warnings + doc: + runs-on: ubuntu-latest + name: nightly / doc + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install nightly + uses: dtolnay/rust-toolchain@nightly + - name: cargo doc + run: cargo doc --no-deps --all-features + env: + RUSTDOCFLAGS: --cfg docsrs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0badf6d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +permissions: + contents: read +on: + push: + branches: [master] + pull_request: +name: test +jobs: + required: + runs-on: ubuntu-latest + name: ubuntu / ${{ matrix.toolchain }} + strategy: + matrix: + toolchain: [nightly] + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install ${{ matrix.toolchain }} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain }} + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + run: cargo generate-lockfile + # https://twitter.com/jonhoo/status/1571290371124260865 + - name: cargo test --locked + run: cargo test --locked --all-features --lib --bins --tests --examples -- --test-threads=1 + - name: cargo bench + run: cargo bench