-
Notifications
You must be signed in to change notification settings - Fork 20
81 lines (71 loc) · 2.16 KB
/
install_and_test.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
name: Install & test
on:
pull_request:
merge_group:
workflow_dispatch:
push:
branches: [main]
jobs:
tests:
name: nix-action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build
run: nix build -L
- name: Install the toolchain
run: |
nix profile install nixpkgs#yq
nix profile install .#rustc
nix profile install .
- name: Ensure readme coherency
run: |
nix build .#check-readme-coherency -L
- name: Test the toolchain
run: |
nix build .#check-toolchain -L
- name: Test the examples
run: |
nix build .#check-examples -L
- name: Checkout specifications
uses: actions/checkout@v3
with:
repository: 'hacspec/specs'
path: specs
- name: Extract specifications
working-directory: specs
run: |
paths=$(tomlq -r '.workspace.members | .[]' Cargo.toml)
for cratePath in $paths; do
crate=$(tomlq -r '.package.name' "$cratePath/Cargo.toml")
for backend in fstar coq; do
for skip in $SKIPLIST; do
if [[ "$skip" == "$crate" || "$skip" == "$crate-$backend" ]]; then
echo "⛔ $crate [$backend] (skipping)"
continue 2
fi
done
echo "::group::$crate [$backend]"
cargo hax -C -p "$crate" \; into "$backend"
echo "::endgroup::"
done
done
env:
SKIPLIST: |
tls_cryptolib
hacspec-merlin
hacspec-halo2-coq
hacspec-halo2-fstar
hacspec-weierstrass-coq
hacspec-weierstrass-fstar
- name: Push to Cachix
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'merge_group' }}
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
run: |
nix profile install nixpkgs#cachix nixpkgs#jq
nix build --json \
| jq -r '.[].outputs | to_entries[].value' \
| cachix push hax