1
1
mirror of https://github.com/oxalica/nil.git synced 2024-08-16 14:10:45 +03:00
nil/.github/workflows/ci.yaml

98 lines
2.7 KiB
YAML
Raw Normal View History

2022-09-19 04:45:49 +03:00
name: CI
on:
pull_request:
push:
2023-03-07 16:47:53 +03:00
permissions:
contents: read
2022-09-19 04:45:49 +03:00
env:
RUST_BACKTRACE: full
jobs:
style:
name: Code style check
2022-09-19 04:45:49 +03:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v22
2023-03-07 16:47:53 +03:00
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare devShell
run: nix develop --command true
2023-02-26 03:28:32 +03:00
- name: Install NPM packages
2023-02-26 03:38:49 +03:00
run: nix develop --command bash -c 'cd editors/coc-nil && npm ci'
- name: Run pre-commit
run: nix develop --command pre-commit
2022-09-19 04:45:49 +03:00
test:
name: Test
strategy:
2023-03-07 16:47:53 +03:00
fail-fast: false
2022-09-19 04:45:49 +03:00
matrix:
os: [ubuntu-latest, macos-latest]
channel: [stable, beta]
2022-09-27 17:17:40 +03:00
include:
- os: ubuntu-latest
2023-11-08 09:05:37 +03:00
# Should be sync with Cargo.toml and README.
channel: '1.70'
2022-09-19 04:45:49 +03:00
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
# For builtins.
- name: Install Nix
uses: cachix/install-nix-action@v22
2023-03-07 16:47:53 +03:00
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2023-07-28 23:27:50 +03:00
nix_path: nixpkgs=channel:nixpkgs-unstable
2022-09-19 04:45:49 +03:00
- name: Build
run: nix develop .#full --command cargo build --workspace --all-targets
2022-09-19 04:45:49 +03:00
- name: Test
run: nix develop .#full --command cargo test --workspace --all-targets
# Waiting for https://github.com/bheisler/criterion.rs/pull/703
- name: Test with ignored
run: nix develop .#full --command cargo test --workspace --all-targets -- --ignored
2022-09-19 04:45:49 +03:00
2022-09-22 16:50:58 +03:00
nix-flake:
2023-03-07 16:47:53 +03:00
name: Flake package
2022-09-19 04:45:49 +03:00
strategy:
2023-03-07 16:47:53 +03:00
fail-fast: false
2022-09-19 04:45:49 +03:00
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@v22
2023-03-07 16:47:53 +03:00
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2022-09-19 04:45:49 +03:00
- name: Flake check
2023-03-07 16:47:53 +03:00
run: nix flake check --no-update-lock-file --show-trace
2022-09-19 04:45:49 +03:00
- name: Flake build
2023-03-07 16:47:53 +03:00
run: nix build --no-update-lock-file --show-trace --print-build-logs
2022-09-22 16:47:46 +03:00
2022-09-22 16:50:58 +03:00
nix-legacy:
2023-03-07 16:47:53 +03:00
name: Legacy package
2022-09-22 16:47:46 +03:00
strategy:
2023-03-07 16:47:53 +03:00
fail-fast: false
2022-09-22 16:47:46 +03:00
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
2022-09-22 17:00:32 +03:00
# flake-compat doesn't support shallow repo.
with:
fetch-depth: 0
2022-09-22 16:47:46 +03:00
- name: Install Nix
uses: cachix/install-nix-action@v22
2022-09-22 16:47:46 +03:00
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
2023-03-07 16:47:53 +03:00
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2022-09-22 16:47:46 +03:00
- name: Nix build
2023-03-07 16:47:53 +03:00
run: nix-build --show-trace