diff options
author | Akshay <[email protected]> | 2022-01-15 05:01:10 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2022-01-15 05:01:10 +0000 |
commit | 01ea0a26c10614ee28955c063dac57993c71eb41 (patch) | |
tree | c573dbfbf87c659558c6101a177a30ee82c1b7be | |
parent | 22edbb06182950204aa4fe78c6fc1065b65bf6a2 (diff) |
init build & test flow
-rw-r--r-- | .github/workflows/build.yml | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e720a52 --- /dev/null +++ b/.github/workflows/build.yml | |||
@@ -0,0 +1,65 @@ | |||
1 | name: build | ||
2 | on: | ||
3 | pull_request: | ||
4 | push: | ||
5 | jobs: | ||
6 | build: | ||
7 | strategy: | ||
8 | matrix: | ||
9 | os: | ||
10 | - ubuntu-latest | ||
11 | - macos-11 | ||
12 | nix: | ||
13 | - name: 2.5.1 | ||
14 | url: https://releases.nixos.org/nix/nix-2.5.1/install | ||
15 | runs-on: ${{ matrix.os }} | ||
16 | steps: | ||
17 | - uses: actions/[email protected] | ||
18 | - uses: cachix/install-nix-action@v15 | ||
19 | with: | ||
20 | install_url: ${{ matrix.nix.url }} | ||
21 | extra_nix_config: | | ||
22 | experimental-features = nix-command flakes | ||
23 | |||
24 | - name: enable binary cache | ||
25 | uses: cachix/cachix-action@v10 | ||
26 | with: | ||
27 | name: statix | ||
28 | authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
29 | |||
30 | - run: nix flake check | ||
31 | |||
32 | - name: build statix | ||
33 | run: nix build -L | ||
34 | |||
35 | - name: build and install statix with flake-compat | ||
36 | run: nix-env -if default.nix | ||
37 | |||
38 | tests: | ||
39 | strategy: | ||
40 | matrix: | ||
41 | os: | ||
42 | - ubuntu-latest | ||
43 | nix: | ||
44 | - name: 2.5.1 | ||
45 | url: https://releases.nixos.org/nix/nix-2.5.1/install | ||
46 | runs-on: ${{ matrix.os }} | ||
47 | steps: | ||
48 | - uses: actions/[email protected] | ||
49 | |||
50 | - uses: cachix/install-nix-action@v15 | ||
51 | with: | ||
52 | install_url: ${{ matrix.nix.url }} | ||
53 | extra_nix_config: | | ||
54 | experimental-features = nix-command flakes | ||
55 | |||
56 | - uses: cachix/cachix-action@v10 | ||
57 | with: | ||
58 | name: statix | ||
59 | authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
60 | |||
61 | - name: set up pinned nixpkgs | ||
62 | run: echo "NIX_PATH=nixpkgs=$(nix-instantiate --eval flake-compat.nix -A defaultNix.inputs.nixpkgs.outPath | sed 's|\"||g')" >> $GITHUB_ENV | ||
63 | |||
64 | - run: nix-shell --run "cargo test" | ||
65 | |||