-
-
Notifications
You must be signed in to change notification settings - Fork 41
94 lines (88 loc) · 2.48 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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@v3
- name: Install Nix
uses: cachix/install-nix-action@v22
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.70'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
# For builtins.
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Build
run: nix develop .#full --command cargo build --all
- name: Test
run: nix develop .#full --command cargo test --all -- --include-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@v3
- name: Install Nix
uses: cachix/install-nix-action@v22
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@v3
# flake-compat doesn't support shallow repo.
with:
fetch-depth: 0
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Nix build
run: nix-build --show-trace