Skip to content

CI pipeline for renovate/cargo-dependencies-(minor-version-bumps) by @renovate[bot] #662

CI pipeline for renovate/cargo-dependencies-(minor-version-bumps) by @renovate[bot]

CI pipeline for renovate/cargo-dependencies-(minor-version-bumps) by @renovate[bot] #662

Workflow file for this run

# Copyright (C) 2025 Kian Kasad
#
# This file is part of the Purdue Hackers webring.
#
# The Purdue Hackers webring is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The Purdue Hackers webring is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
# for more details.
#
# You should have received a copy of the GNU Affero General Public License along
# with the Purdue Hackers webring. If not, see <https://www.gnu.org/licenses/>.
name: CI
run-name: |
${{
format(
'CI pipeline for {0} by @{1}',
github.event_name == 'pull_request' && format('#{0}', github.event.number) || github.ref_name,
github.actor
)
}}
on:
workflow_dispatch:
push:
pull_request:
branches:
- master
- "release/*"
env:
RUST_BACKTRACE: short
jobs:
clippy:
name: Lint Rust code
runs-on: ubuntu-latest
env:
RUSTFLAGS: '-D warnings'
steps:
- name: Check out sources
uses: actions/checkout@v6
- name: Set up Rust toolchain
run: rustup install --profile minimal --component clippy
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Lint Rust code
run: cargo clippy --all-targets --workspace --locked
prettier:
name: Lint UI code
runs-on: ubuntu-latest
steps:
- name: Check out sources
uses: actions/checkout@v6
- name: Install pNPM
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: |
pnpm install
echo "PATH=$(pwd)/node_modules/.bin:$PATH" >> $GITHUB_ENV
- name: Lint UI code
run: prettier --check --config .prettierrc static
fmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: Check out sources
uses: actions/checkout@v6
- name: Set up Rust toolchain
run: rustup install --profile minimal --component rustfmt
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Check formatting
run: cargo fmt --check --all
test:
name: Run tests
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: read
steps:
- name: Check out sources
uses: actions/checkout@v6
- name: Set up Rust toolchain
run: rustup install --profile minimal --component llvm-tools
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
cache-bin: false
- name: Cache test tools
id: cache-test-tools
uses: actions/cache@v5
with:
key: cargo-bin-${{ runner.os }}-${{ runner.arch }}-1
path: ~/.cargo/bin
- name: Install test tools
if: ${{ steps.cache-test-tools.outputs.cache-hit != 'true' }}
# If changing the list of tools, be sure to increment the number at the
# end of the cache key in the previous step.
run: cargo install --locked cargo-nextest cargo-llvm-cov
- name: Run tests
run: >-
cargo llvm-cov nextest
--no-report
--no-fail-fast
--locked
--workspace
--all-targets
--all-features
--profile ci
- name: Generate coverage reports
if: ${{ !cancelled() }} # Generate reports even if tests failed
shell: bash
run: |
cargo llvm-cov report --html
cargo llvm-cov report --codecov --output-path target/llvm-cov/codecov.json
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ !cancelled() }} # Upload reports even if tests failed
with:
check_run: false
comment_mode: ${{ (github.event_name == 'pull_request') && 'always' || 'off' }}
files: |
target/nextest/ci/junit.xml
- name: Upload test results to Codecov
if: ${{ !cancelled() }} # Upload reports even if tests failed
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: target/nextest/ci/junit.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: ${{ !cancelled() }} # Upload reports even if tests failed
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/llvm-cov/codecov.json
- name: Upload HTML coverage report
uses: actions/upload-artifact@v6
if: ${{ !cancelled() }} # Upload reports even if tests failed
with:
name: coverage-html
path: target/llvm-cov/html/
# Adding this because we don't want to run the whole build workflow on each
# push
build:
name: Build project
runs-on: ubuntu-latest
steps:
- name: Check out sources
uses: actions/checkout@v6
- name: Set up Rust toolchain
run: rustup install --profile minimal
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Compile project
run: cargo build --workspace --all-targets --release --locked
deploy:
name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
needs:
- build
- test
runs-on: ubuntu-latest
environment: Production
concurrency:
group: deploy-production
cancel-in-progress: true
steps:
- name: Check out sources
uses: actions/checkout@v6
with:
sparse-checkout: ci/ssh
- name: Configure SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
rsync -vr ci/ssh/ ~/.ssh
echo "${SSH_PRIVATE_KEY}" > ~/.ssh/id_ed25519
chmod -R u=rwX,g=,o= ~/.ssh
- name: Build on Vulcan
run: ssh vulcan nix build "github:${{ github.repository }}/${{ github.sha }}"
- name: Deploy on Vulcan
run: ssh vulcan home-manager switch --flake "github:${{ github.repository }}/${{ github.sha }}"