-
Notifications
You must be signed in to change notification settings - Fork 19
197 lines (174 loc) · 6.4 KB
/
build.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: Build
on:
push:
branches:
- 'master'
paths-ignore:
- '**.md'
- '**.gitignore'
- '**.opam'
- '**.editorconfig'
- 'LICENSE'
- 'papers/**'
- 'extra/docker/**'
pull_request:
paths-ignore:
- '**.md'
- '**.gitignore'
- '**.opam'
- '**.editorconfig'
- 'LICENSE'
- 'papers/**'
- 'extra/docker/**'
permissions:
contents: read
env:
OCAML_COMILER_VERSION: "4.13.1"
JOBS: 2
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout branch ${{ github.ref_name }}
uses: actions/checkout@v4
- run: sudo apt-get update
- name: Restore opam cache
id: opam-cache
uses: actions/cache@v4
with:
path: "~/.opam"
key: opam-${{env.OCAML_COMILER_VERSION}}-${{hashFiles('.github/coq-concert.opam.locked')}}
restore-keys: |
opam-${{env.OCAML_COMILER_VERSION}}-
- name: Set up OCaml
uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{env.OCAML_COMILER_VERSION}}
- name: Build dependencies
#if: ${{ !steps.opam-cache.outputs.cache-hit }}
run: |
opam repo add coq-released https://coq.inria.fr/opam/released
opam install --deps-only -j${{ env.JOBS }} .github/coq-concert.opam.locked
opam install -y -j${{ env.JOBS }} coq-dpdgraph
opam clean -a -c -s --logs
- name: Set up environment
run: |
echo "::group::Setting up problem matcher"
echo "::add-matcher::./.github/coq-errors.json"
echo "::endgroup::"
- name: Build core
run: |
echo "::group::Build utilities"
opam exec -- make -j${{ env.JOBS }} utils
echo "::endgroup::"
echo "::group::Build execution layer"
opam exec -- make -j${{ env.JOBS }} execution
echo "::endgroup::"
echo "::group::Build embedding layer"
opam exec -- make -j${{ env.JOBS }} embedding
echo "::endgroup::"
echo "::group::Build extraction layer"
opam exec -- make -j${{ env.JOBS }} extraction
echo "::endgroup::"
- name: Build examples
run: |
echo "::group::Build examples"
opam exec -- make -j${{ env.JOBS }} examples
echo "::endgroup::"
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
target: wasm32-unknown-unknown
- name: Set up Concordium tools
run: |
curl -L -O https://distribution.concordium.software/tools/linux/cargo-concordium_1.0.0
sudo chmod +x cargo-concordium_1.0.0
sudo mv cargo-concordium_1.0.0 /usr/local/bin/cargo-concordium
- name: Set up LIGO v0.59.0
run: |
curl -L -O https://gitlab.com/ligolang/ligo/-/jobs/3553205311/artifacts/raw/ligo
sudo chmod +x ./ligo
sudo mv ligo /usr/local/bin/
- name: Set up Liquidity
run: |
sudo chmod +x ./extra/docker/liquidity
sudo mv extra/docker/liquidity /usr/local/bin/
- name: Test extraction
run: |
echo "::group::Running tests"
git config --global url.https://github.com/.insteadOf [email protected]:
make -j${{ env.JOBS }} test-extraction
echo "::endgroup::"
- name: Upload Liquidity extraction logs
if: false # Do we still want these logs?
uses: actions/upload-artifact@v4
with:
name: Liquidity logs
path: extraction/tests/extracted-code/liquidity-extract/liquidity.log
retention-days: 14
- name: Prepare extraction results
if: github.event_name == 'push' && github.repository == 'AU-COBRA/ConCert' && github.ref == 'refs/heads/master'
run: |
echo "::group::Cleaning up extracted code"
make -j${{ env.JOBS }} clean-extraction-out-files
make -j${{ env.JOBS }} clean-compiled-extraction
find extraction/tests/extracted-code -name 'placeholder' -delete
echo "::endgroup::"
cp LICENSE extraction/tests/extracted-code/LICENSE
cp extra/extraction-results.md extraction/tests/extracted-code/README.md
cp .gitattributes extraction/tests/extracted-code/.gitattributes
- name: Push to the extraction results repository
# don't push the extraction results on pull requests and push only from the master branch of the AU-COBRA/ConCert repo.
if: github.event_name == 'push' && github.repository == 'AU-COBRA/ConCert' && github.ref == 'refs/heads/master'
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.EXTRACTION_RESULTS_DEPLOY_KEY }}
with:
source-directory: 'extraction/tests/extracted-code'
destination-github-username: 'AU-COBRA'
destination-repository-name: 'extraction-results'
user-email: [email protected]
commit-message: See ORIGIN_COMMIT from $GITHUB_REF
target-branch: master
- name: Build documentation
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
echo "::group::Running coqdoc"
opam exec -- make -j${{ env.JOBS }} html
echo "::endgroup::"
echo "::group::Install dependencies"
sudo apt install -y graphviz
echo "::endgroup::"
echo "::group::Generate dependency graphs"
rm -rf docs/graphs
mkdir -p docs
mkdir -p docs/graphs
opam exec -- make dependency-graphs
mv utils/svg/* docs/graphs/
mv execution/svg/* docs/graphs/
mv embedding/svg/* docs/graphs/
mv extraction/svg/* docs/graphs/
mv examples/svg/* docs/graphs/
echo "::endgroup::"
- name: Prepare documentation for deployment
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v3
with:
path: docs
deploy-docs:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4