Skip to content

Commit

Permalink
Add a nix flake check job. Add comments on CI jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchmindtree committed Jan 21, 2024
1 parent c51c497 commit 1551b42
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/nannou.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
name: nannou
on: [push, pull_request]
jobs:
# Check the nix code is formatted.
nix-fmt-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- run: nix fmt -- --check ./

# Check the nix flake is valid on macos and linux.
nix-flake-check:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- run: nix flake check

# A colleciton of cargo verifications that should pass before landing PRs.
cargo-verifications:
runs-on: ubuntu-latest
strategy:
Expand All @@ -29,12 +43,20 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: nix develop --command ${{ matrix.command }}

# Synchronise the verification jobs under one that we can depend on for publish jobs.
verifications:
needs: [ cargo-verifications, nix-fmt-check ]
needs:
[
cargo-verifications,
nix-flake-check,
nix-fmt-check,
]
runs-on: ubuntu-latest
steps:
- run: echo "Verifications complete"

# Publish all the crates.
# TODO: There's probs a single action out there for publishing a whole workspacce?
cargo-publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [ verifications ]
Expand Down Expand Up @@ -70,8 +92,10 @@ jobs:
continue-on-error: true
run: cargo publish --token $CRATESIO_TOKEN --manifest-path nannou_egui/Cargo.toml

# Publish the guide by pushing it to `deploy` branch.
guide-push-to-deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [ verifications ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down

0 comments on commit 1551b42

Please sign in to comment.