-
Notifications
You must be signed in to change notification settings - Fork 21
156 lines (126 loc) · 3.88 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: ci
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
fixpoint:
runs-on: ubuntu-latest
steps:
- name: Clone fixpoint
run: |
git clone https://github.com/ucsd-progsys/liquid-fixpoint
echo "fixpoint_hash=$(git -C liquid-fixpoint/ rev-parse HEAD)" >> $GITHUB_ENV
echo "local_binaries_path=$(pwd)/local-binaries" >> $GITHUB_ENV
- name: Cache fixpoint
uses: actions/cache@v4
id: cache-fixpoint
with:
path: local-binaries
key: fixpoint-bin-${{ runner.os }}-${{ env.fixpoint_hash }}
- name: Install Haskell
if: steps.cache-fixpoint.outputs.cache-hit != 'true'
uses: haskell-actions/setup@v2.7.0
with:
enable-stack: true
stack-version: "latest"
- name: Compile fixpoint
if: steps.cache-fixpoint.outputs.cache-hit != 'true'
run: |
cd liquid-fixpoint
stack install --fast --local-bin-path "$local_binaries_path" --flag liquid-fixpoint:-link-z3-as-a-library
- name: Upload Fixpoint
uses: actions/upload-artifact@v4.4.3
with:
name: fixpoint
path: ${{ env.local_binaries_path }}/fixpoint
tests:
runs-on: ubuntu-latest
needs: fixpoint
steps:
- uses: actions/checkout@v4
- name: Download Fixpoint
uses: actions/download-artifact@v4.1.8
with:
name: fixpoint
path: ~/.local/bin/
- name: Add fixpoint to PATH
run: chmod 755 ~/.local/bin/fixpoint && echo ~/.local/bin >> $GITHUB_PATH
- run: which fixpoint
- name: Install Z3
uses: cda-tum/setup-z3@v1.6.1
with:
version: 4.12.1
platform: linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.5
- name: Build
run: |
cargo build
- name: Run tests
run: |
which fixpoint && cargo xtask test
vtock:
runs-on: ubuntu-latest
needs: fixpoint
steps:
- uses: actions/checkout@v4
- name: Download Fixpoint
uses: actions/download-artifact@v4.1.8
with:
name: fixpoint
path: ~/.local/bin/
- name: Add fixpoint to PATH
run: chmod 755 ~/.local/bin/fixpoint && echo ~/.local/bin >> $GITHUB_PATH
- name: Install Z3
uses: cda-tum/setup-z3@v1.6.1
with:
version: 4.12.1
platform: linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.5
- name: Install Flux
run: |
cargo x install
echo ~/.cargo/bin >> $GITHUB_PATH
- name: Clone vtock
run: |
git clone https://github.com/PLSysSec/tock
cp rust-toolchain tock/rust-toolchain.toml
- name: Patch flux-rs dependency if in pull request
if: github.event_name == 'pull_request'
run: |
echo '[patch."https://github.com/flux-rs/flux.git"]' >> tock/Cargo.toml
echo 'flux-rs = { path = "../lib/flux-rs" }' >> tock/Cargo.toml
- name: Check tock/kernel
run: |
cd tock
cargo flux -p kernel
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.5
- name: Rust rustfmt
run: cargo fmt --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Add clippy
run: rustup component add clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.5
- name: Run check
run: RUSTFLAGS="-Dwarnings" cargo check
- name: Run clippy
uses: actions-rs/clippy-check@v1.0.7
with:
token: ${{ secrets.GITHUB_TOKEN }}