mirror of
https://github.com/oxalica/nil.git
synced 2025-12-23 09:19:49 +00:00
122 lines
3.4 KiB
YAML
122 lines
3.4 KiB
YAML
name: CI
|
|
on:
|
|
pull_request:
|
|
push:
|
|
schedule:
|
|
- cron: '23 1 * * *' # *-*-* 01:23:00 UTC
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
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@v20
|
|
with:
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Prepare devShell
|
|
run: nix develop --command true
|
|
- name: Install NPM packages
|
|
run: nix develop --command bash -c 'cd editors/coc-nil && npm ci'
|
|
- name: Run pre-commit
|
|
run: nix develop --command pre-commit
|
|
|
|
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
|
|
channel: '1.68'
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
# For builtins.
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v20
|
|
with:
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.channel }}
|
|
- name: Build
|
|
run: cargo build --all
|
|
- name: Test
|
|
run: cargo test --all -- --include-ignored
|
|
|
|
nix-flake:
|
|
name: Flake package
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
deps: [latest, locked]
|
|
os: [ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v20
|
|
with:
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Flake update
|
|
if: matrix.deps == 'latest'
|
|
# https://github.com/actions/checkout/tree/v3.3.0#push-a-commit-using-the-built-in-token
|
|
run: |
|
|
git config user.name github-actions
|
|
git config user.email github-actions@github.com
|
|
nix flake update --commit-lock-file
|
|
- 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@v3
|
|
# flake-compat doesn't support shallow repo.
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v20
|
|
with:
|
|
nix_path: nixpkgs=channel:nixpkgs-unstable
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Nix build
|
|
run: nix-build --show-trace
|
|
|
|
outdated:
|
|
name: Outdated
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name != 'pull_request'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Install cargo-outdated
|
|
uses: dtolnay/install@cargo-outdated
|
|
- name: cargo-outdated
|
|
run: |
|
|
rm Cargo.lock # Ignore trivially updatable compatible versions.
|
|
cargo outdated --workspace --exit-code 1
|