Skip to content

Commit

Permalink
add quick-CI
Browse files Browse the repository at this point in the history
  • Loading branch information
MusicalNinjaDad committed Apr 6, 2024
1 parent eef653b commit 8f32195
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/ci-quick.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Quick CI

# A short version of the CI, designed to run in seconds (<200s) on every push.
# Runs lints & basic tests on ALL branches EXCEPT main.

on:
push:
branches-ignore:
- main

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: python -m pip install --upgrade pip && pip install nox
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check python formatting and lints (ruff)
run: nox -s ruff
- name: Check rust formatting (rustfmt)
run: nox -s rustfmt

semver-checks:
if: github.ref != 'refs/heads/main'
needs: [fmt]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: obi1kenobi/cargo-semver-checks-action@v2

clippy:
needs: [fmt]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rust-src
- uses: actions/setup-python@v5
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.event_name != 'merge_group' }}
- run: python -m pip install --upgrade pip && pip install nox
- run: nox -s clippy

tests:
name: test rust skip-full
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.event_name != 'merge_group' }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rust-src
- run: python -m pip install --upgrade pip && pip install nox
- run: nox -s test-rust -- skip-full
4 changes: 4 additions & 0 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ The main nox commands we have implemented are:
* `nox -s codspeed` will run our suite of rust and python performance tests
* `nox -s coverage` will analyse test coverage and output `coverage.json` (alternatively: `nox -s coverage lcov` outputs `lcov.info`)

### Github workflow

In addition to the larger CI workflow which runs on each Pull Request, we provide a short CI workflow which runs on every push to github. This workflow runs the nox sessions: `fustfmt`, `ruff`, `clippy` and `test-rust -- skip-full` and is designed to run in under 200s to provide feedback within a reasonable timeframe and not use all your github actions minutes.

## Ways to help

### Help users identify bugs
Expand Down

0 comments on commit 8f32195

Please sign in to comment.