-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (100 loc) · 4.1 KB
/
CI-camkes.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
name: CAmkES
on:
push:
schedule:
- cron: "0 2 * * 6" # every sunday at 2am
workflow_dispatch:
inputs:
docker_image:
type: string
description: Docker image to fetch
default: trustworthysystems/camkes
verbose:
type: boolean
description: Enable verbose testing output
default: false
jobs:
container:
runs-on: ubuntu-latest
container:
image: ${{ inputs.docker_image != '' && inputs.docker_image || 'trustworthysystems/camkes' }}
strategy:
fail-fast: false
matrix:
VM_PARTITION: [false, true]
name: 'VM Partition=${{ matrix.VM_PARTITION }}'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: hamr-codegen
submodules: recursive
- name: Retrieve versions.properties
run: |
wget -q https://raw.githubusercontent.com/sireum/kekinian/master/versions.properties
- name: Cache Java
id: cache-java
uses: actions/cache@v4
with:
path: bin/linux/java
key: ${{ runner.os }}-${{ hashFiles('versions.properties') }}-java
- name: Cache Scala
id: cache-scala
uses: actions/cache@v4
with:
path: bin/scala
key: ${{ runner.os }}-${{ hashFiles('versions.properties') }}-scala
- name: Cache Coursier
id: cache-coursier
uses: actions/cache@v4
with:
path: cache/coursier
key: ${{ runner.os }}-${{ hashFiles('versions.properties') }}-coursier
- name: Cache OSATE
id: cache-osate
uses: actions/cache@v4
with:
path: bin/linux/osate
key: ${{ runner.os }}-${{ hashFiles('jvm/src/main/resources/phantom_versions.properties') }}-osate
- name: Build
env:
# add verbose flag if workflow is restarted with "enable debug logging" checked or if requested
# via workflow dispatch
VERBOSE_DEBUG: ${{ ( runner.debug == '1' || inputs.verbose == '1' ) && ',verbose' || '' }}
run: |
# github sets HOME to /github/home but some tools (Sireum's Os.home, Haskell) use
# the containers /root instead leading to inconsistent installs. Setting HOME
# to be root resolves the issue
# https://github.com/actions/runner/issues/1474#issuecomment-965805123
export HOME=/root
mv ./hamr-codegen /root/
export aptInstall="apt-get install -f -y --no-install-recommends"
export DEBIAN_FRONTEND=noninteractive
apt-get update
${aptInstall} p7zip-full
# Installing emacs installs some package(s) that resolve an issue where
# the OSATE gumbo parser fails to initialize when used in the docker container.
${aptInstall} emacs
mkdir -p $HOME/.ssh
touch $HOME/.ssh/config
chmod 700 $HOME/.ssh/config
(echo "Host gitlab.adventium.com"; echo "StrictHostKeyChecking no") >> $HOME/.ssh/config
export CASE_DIR=$HOME/CASE
mkdir -p $CASE_DIR/camkes
cd $CASE_DIR/camkes
repo init -u https://github.com/seL4/camkes-manifest.git
repo sync
mkdir -p $CASE_DIR/camkes-vm-examples
cd $CASE_DIR/camkes-vm-examples
repo init -u https://github.com/seL4/camkes-vm-examples-manifest.git
repo sync
export VM_PARTITION=${{ matrix.VM_PARTITION }}
echo "VM_PARTITION=${VM_PARTITION}"
# see https://github.com/sireum/hamr-codegen-test/blob/master/scala/org/sireum/hamr/codegen/test/util/TestMode.scala
export testmodes=phantom,sergen,slangcheck,tipe,ive,compile,camkes,generated_unit_tests,smt2${VERBOSE_DEBUG}
echo "testmodes=${testmodes}"
export SMT2_TIMEOUT=180000
echo "SMT2_TIMEOUT=${SMT2_TIMEOUT}"
export ALSO_TRANSPILE_VIA_CALLBACKS=true
echo "ALSO_TRANSPILE_VIA_CALLBACKS=${ALSO_TRANSPILE_VIA_CALLBACKS}"
$HOME/hamr-codegen/bin/build.cmd test