mirror of
https://github.com/oxalica/nil.git
synced 2025-12-23 09:19:49 +00:00
97 lines
2.7 KiB
YAML
97 lines
2.7 KiB
YAML
name: CI
|
|
on:
|
|
pull_request:
|
|
push:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
RUST_BACKTRACE: full
|
|
|
|
jobs:
|
|
style:
|
|
name: Code style check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v31
|
|
with:
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Prepare devShell
|
|
run: nix develop ./dev --command true
|
|
- name: Install NPM packages
|
|
run: nix develop ./dev --command bash -c 'cd editors/coc-nil && npm ci'
|
|
- name: Run pre-push
|
|
run: nix develop ./dev --command bash ./dev/pre-push.sh
|
|
|
|
test:
|
|
name: Test
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
channel: [stable, beta]
|
|
include:
|
|
- os: ubuntu-latest
|
|
# Should be sync with Cargo.toml and README.
|
|
channel: '1.77'
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
# For builtins.
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v31
|
|
with:
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
nix_path: nixpkgs=channel:nixpkgs-unstable
|
|
- name: Build
|
|
run: nix develop ./dev#full --command cargo build --workspace --all-targets
|
|
- name: Test
|
|
run: nix develop ./dev#full --command cargo test --workspace --all-targets
|
|
# Waiting for https://github.com/bheisler/criterion.rs/pull/703
|
|
- name: Test with ignored
|
|
run: nix develop ./dev#full --command cargo test --workspace --all-targets -- --ignored
|
|
|
|
nix-flake:
|
|
name: Flake package
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v31
|
|
with:
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Flake check
|
|
run: nix flake check --no-update-lock-file --show-trace
|
|
- name: Flake build
|
|
run: nix build --no-update-lock-file --show-trace --print-build-logs
|
|
|
|
nix-legacy:
|
|
name: Legacy package
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
# flake-compat doesn't support shallow repo.
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v31
|
|
with:
|
|
nix_path: nixpkgs=channel:nixpkgs-unstable
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Nix build
|
|
run: nix-build --show-trace
|