-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (105 loc) · 3.27 KB
/
ci.yml
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: "ci"
on:
push:
paths-ignore:
- '**.md'
branches:
- main
pull_request:
types: [opened, synchronize]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: cachix/cachix-action@v12
with:
name: integrated-reasoning
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: build mps
run: |
if [[ $RUNNER_OS == Linux ]]; then
nix build
else
nix build \
--override-input nixpkgs github:nixos/nixpkgs/nixpkgs-23.05-darwin
fi
- name: build tests
run: |
if [[ $RUNNER_OS == Linux ]]; then
nix develop --command cargo test-all-features
else
nix develop \
--override-input nixpkgs github:nixos/nixpkgs/nixpkgs-23.05-darwin \
--command cargo test-all-features
fi
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: cachix/cachix-action@v12
with:
name: integrated-reasoning
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: nix develop --command cargo fmt --all --check
- name: Run Clippy
run: nix develop --command cargo clippy --all-targets --all-features
- name: Run cargo-deny
run: nix develop --command cargo deny check
- name: Check flake
run: nix flake check
- name: Check nix shell
run: nix develop --ignore-environment --command "rustc" "--version"
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: cachix/cachix-action@v12
with:
name: integrated-reasoning
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}
- name: Generate code coverage
run: nix develop --command cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info nextest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true