mirror of
https://github.com/oxalica/nil.git
synced 2025-12-23 09:19:49 +00:00
82 lines
2 KiB
YAML
82 lines
2 KiB
YAML
name: CI
|
|
on:
|
|
pull_request:
|
|
push:
|
|
|
|
env:
|
|
RUST_BACKTRACE: full
|
|
|
|
jobs:
|
|
style:
|
|
name: Code style check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v17
|
|
- name: Prepare devShell
|
|
run: nix develop --command true
|
|
- name: Run pre-commit
|
|
run: nix develop --command pre-commit
|
|
|
|
test:
|
|
name: Test
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
channel: [stable, beta]
|
|
include:
|
|
- os: ubuntu-latest
|
|
channel: "1.62.0"
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
# For builtins.
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v17
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: ${{ matrix.channel }}
|
|
- name: Build
|
|
run: cargo build --all
|
|
- name: Test
|
|
run: cargo test --all -- --include-ignored
|
|
|
|
nix-flake:
|
|
name: Nix package (flake)
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v17
|
|
- name: Flake check
|
|
run: nix flake check --no-update-lock-file --show-trace --verbose
|
|
- name: Flake build
|
|
run: nix build --no-update-lock-file --show-trace --verbose --print-build-logs
|
|
|
|
nix-legacy:
|
|
name: Nix package (legacy)
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
# flake-compat doesn't support shallow repo.
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v17
|
|
with:
|
|
nix_path: nixpkgs=channel:nixpkgs-unstable
|
|
- name: Nix build
|
|
run: nix-build --show-trace --verbose
|