bakare/.forgejo/workflows/build.yaml
Cyryl Płotnicki dcb7a1ed89
All checks were successful
build / build-cargo (push) Successful in 6m3s
build / build-nix (push) Successful in 2m59s
build / check-nix (push) Successful in 3m13s
add rust build cache on ci
2024-04-27 11:41:31 +01:00

70 lines
1.9 KiB
YAML

name: build
on: push
env:
DEV_SHELL_NAME: CI
CI: true
jobs:
build-cargo:
runs-on: flakes-action
steps:
- uses: actions/checkout@v3
name: Checkout
- uses: https://github.com/DeterminateSystems/magic-nix-cache-action@main
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: |
nix develop -c cargo nextest run --run-ignored all
- name: Build release
run: |
nix develop -c cargo build --release
build-nix:
runs-on: flakes-action
steps:
- uses: actions/checkout@v3
name: Checkout
- uses: https://github.com/DeterminateSystems/magic-nix-cache-action@main
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name:
run: |
nix build
check-nix:
runs-on: flakes-action
steps:
- uses: actions/checkout@v3
name: Checkout
- name: Metadata
run: |
nix flake metadata
- uses: https://github.com/DeterminateSystems/magic-nix-cache-action@main
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Statix
run: |
nix develop -c statix check
- name: Flake check
run: |
nix flake check