From 2cfc3731181beac4ba6ae8aee23989d3ab7e2ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Fri, 5 Jan 2024 10:13:52 -0500 Subject: [PATCH] Refactor GitHub workflows - The pull request introduces predefined GitHub actions for CI env setup from `lurk-lab/ci-workflows` to simplify the existing Rust action workflow, - A new workflow for generating and deploying crate docs has been added, triggering on push to the `dev` branch and on changes in Rust and Cargo files. - Updates have been made to the dependabot configuration to enable 'minor' and 'patch' types for rust dependencies. - Lastly, a new nightly workflow is set up for sanity checks, including jobs to examine unused dependencies and verify rust version. --- .github/dependabot.yml | 3 +++ .github/workflows/docs.yml | 15 +++++++++++++++ .github/workflows/nightly.yml | 22 ++++++++++++++++++++++ .github/workflows/rust.yml | 30 ++++++------------------------ 4 files changed, 46 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/nightly.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 98e028a25..95dc07ac7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,6 +10,9 @@ updates: rust-dependencies: patterns: - "*" + update-types: + - "minor" + - "patch" open-pull-requests-limit: 5 - package-ecosystem: "github-actions" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..e683ea260 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,15 @@ +name: Generate and deploy crate docs + +on: + push: + branches: + - dev + paths: + - "**.rs" + - "Cargo.toml" + - "Cargo.lock" + workflow_dispatch: + +jobs: + docs: + uses: lurk-lab/ci-workflows/.github/workflows/docs.yml@main \ No newline at end of file diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..eb5f2bc00 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,22 @@ +# Nightly sanity checks +name: nightly + +on: + workflow_dispatch: {} + # Once per day at 00:00 UTC + schedule: + - cron: "0 0 * * *" + +env: + CARGO_TERM_COLOR: always + +jobs: + unused-dependencies: + runs-on: ubuntu-latest + steps: + - uses: lurk-lab/ci-workflows/.github/workflows/unused-deps.yml@main + + rust-version-check: + runs-on: ubuntu-latest + steps: + - uses: lurk-lab/ci-workflows/.github/workflows/rust-version-check.yml \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index af696ef84..838713e4a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,13 +9,6 @@ on: - 'feat/**' - release-candidate -env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - CARGO_NET_RETRY: 10 - RUSTUP_MAX_RETRIES: 10 - RUST_BACKTRACE: short - concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true @@ -26,6 +19,10 @@ jobs: env: RUSTFLAGS: -D warnings steps: + - uses: actions/checkout@v4 + with: + repository: lurk-lab/ci-workflows + - uses: ./.github/actions/ci-env - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: taiki-e/install-action@nextest @@ -49,24 +46,9 @@ jobs: env: RUSTFLAGS: -D warnings steps: - - uses: actions/checkout@v4 + - uses: lurk-lab/ci-workflows/.github/workflows/check-lurk-compiles.yml@main with: - path: ${{ github.workspace }}/arecibo - - uses: actions/checkout@v4 - with: - repository: lurk-lab/lurk-rs - path: ${{ github.workspace }}/lurk - submodules: recursive - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - name: Patch Cargo.toml - working-directory: ${{ github.workspace }}/lurk - run: | - echo "[patch.'https://github.com/lurk-lab/arecibo']" >> Cargo.toml - echo "nova = { path='../arecibo', package='arecibo' }" >> Cargo.toml - - name: Check Lurk-rs types don't break spectacularly - working-directory: ${{ github.workspace }}/lurk - run: cargo check --all --tests --benches --examples + package-name: arecibo # Wasm build, rustfmt, clippy, doctests, and MSRV code-quality: