Skip to content

Workflow file for this run

name: Check and build
on: [ "push", "pull_request" ]
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Configure Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check Nix inputs
uses: DeterminateSystems/flake-checker-action@main
with:
fail-mode: true
- name: Check Formatting
run: |
nix develop --command \
cargo fmt --all -- --check
- name: Audit rust dependencies
run: |
nix develop --command \
cargo deny check
- name: Check spelling
run: |
nix develop --command \
codespell \
--skip target,.git \
--ignore-words-list crate
build:
runs-on: ubuntu-latest
needs: [ "check" ]
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Configure Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Setup rust cache
uses: actions/cache@v3
with:
key: photonic-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
- name: Build
run: |
nix develop --command \
cargo build --all --verbose
- name: Run tests
run: |
nix develop --command \
cargo test --all --verbose
package:
runs-on: ubuntu-latest
needs: [ "check" ]
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Configure Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build package
run: |
nix build .#photonic