Skip to content

Commit 1ce7114

Browse files
committed
add ci
1 parent db4d454 commit 1ce7114

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Test"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
tests:
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest, macos-latest]
13+
runs-on: ${{ matrix.os }}
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: cachix/install-nix-action@v26
18+
- uses: cachix/cachix-action@v14
19+
with:
20+
name: devenv
21+
- name: Install devenv.sh
22+
run: nix profile install nixpkgs#devenv
23+
24+
- name: Build the devenv shell and run any pre-commit hooks
25+
run: devenv test

devenv.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
{
22
languages.rust.enable = true;
3+
4+
pre-commit.hooks = {
5+
cargo-check.enable = true;
6+
rustfmt.enable = true;
7+
clippy.enable = true;
8+
};
9+
10+
enterTest = ''
11+
cargo test --all --verbose
12+
'';
313
}

0 commit comments

Comments
 (0)