Skip to content

Commit

Permalink
ci: Refactor GitHub workflows (#236)
Browse files Browse the repository at this point in the history
* 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.

* fix: remove obsolete package-name

* fix: review nit
  • Loading branch information
huitseeker authored Jan 8, 2024
1 parent 96fd5f5 commit f8771a2
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ updates:
rust-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"
open-pull-requests-limit: 5

- package-ecosystem: "github-actions"
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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:
uses: lurk-lab/ci-workflows/.github/workflows/unused-deps.yml@main

rust-version-check:
uses: lurk-lab/ci-workflows/.github/workflows/rust-version-check.yml@main
39 changes: 7 additions & 32 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,18 @@ 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

jobs:
build:
runs-on: buildjet-8vcpu-ubuntu-2204
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
Expand All @@ -44,29 +39,9 @@ jobs:
cargo nextest run --profile ci --workspace --cargo-profile dev-ci --features "asm" -E 'test(test_pp_digest)'
check-lurk-compiles:
if: github.event_name == 'pull_request'
runs-on: buildjet-8vcpu-ubuntu-2204
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v4
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
uses: lurk-lab/ci-workflows/.github/workflows/check-lurk-compiles.yml@main
with:
runner: "buildjet-8vcpu-ubuntu-2204"

# Wasm build, rustfmt, clippy, doctests, and MSRV
code-quality:
Expand Down

0 comments on commit f8771a2

Please sign in to comment.