-
Notifications
You must be signed in to change notification settings - Fork 3
196 lines (165 loc) · 6.52 KB
/
main.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
# This CI configuration is inspired by
#
# https://kodimensional.dev/github-actions
#
# It builds with a majority of the latest compiler releases from each major GHC
# revision on Linux and builds macOS and Windows against the latest GHC.
name: CI Matrix
# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]
jobs:
docker:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
submodules: 'false'
- name: Setup subrepos
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:"
git config --global url."https://".insteadOf "git://"
git submodule update --init
- name: Artifactory Login
uses: docker/login-action@v2
with:
registry: artifactory.galois.com:5025
username: ${{ secrets.ARTIFACTORY_USER }}
password: ${{ secrets.ARTIFACTORY_KEY }}
# Pulls the latest image to try to re-use some layers
- name: Pull Latest Docker image
run: |
docker pull artifactory.galois.com:5025/pate/pate:${GITHUB_REF//\//\-} || \
docker pull artifactory.galois.com:5025/pate/pate:refs-heads-master || \
echo "No latest image found"
- name: Build Docker Image
run: |
docker build . \
--cache-from artifactory.galois.com:5025/pate/pate:${GITHUB_REF//\//\-} \
--cache-from artifactory.galois.com:5025/pate/pate:refs-heads-master \
-t pate
- name: Test Docker Image
run: |
docker run --rm --entrypoint cabal pate run pate-test-aarch32 -- -p args-equal > out.log
cat out.log
grep -e "All .* tests passed" out.log || exit 1
- name: Push Docker image
run: |
CI_COMMIT_SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)
docker tag pate artifactory.galois.com:5025/pate/pate:$CI_COMMIT_SHORT_SHA
docker tag pate artifactory.galois.com:5025/pate/pate:${GITHUB_REF//\//\-}
docker push -a artifactory.galois.com:5025/pate/pate
build:
runs-on: ${{ matrix.os }}
env:
LANG: en_US.UTF-8
LANGUAGE: en_US:en
LC_ALL: en_US.UTF-8
TZ: America/Los_Angeles
CACHE_VERSION: 5
strategy:
fail-fast: false
matrix:
arch: [ 'ppc' ]
ghc: ['9.6.2']
cabal: ['3.10.2.0']
os: [self-hosted]
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }} pate-${{ matrix.arch }}
steps:
- uses: actions/checkout@v2
with:
submodules: 'false'
- name: Setup subrepos and cabal.project
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:"
git config --global url."https://".insteadOf "git://"
git submodule update --init
cp cabal.project.dist cabal.project
- name: Installing the freeze file
run: mv cabal.GHC-${{ matrix.ghc }}.freeze cabal.project.freeze
- uses: actions/cache/restore@v4
name: Restore GHCup
id: cache-ghcup
with:
path: ~/.ghcup
key: ${{ env.CACHE_VERSION }}-pate-ghcup-${{ runner.os }}-${{ matrix.ghc }}
- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache/save@v4
name: Save GHCup
with:
path: ~/.ghcup
key: ${{ steps.cache-ghcup.outputs.cache-primary-key }}
- name: System Dependencies
run: |
sudo apt update
sudo apt install -y software-properties-common apt-transport-https ca-certificates wget
sudo apt install -y bsdiff curl zlibc zlib1g zlib1g-dev git zip \
libgmp3-dev build-essential libtinfo-dev autoconf automake gperf cmake locales \
python3-distutils python-setuptools antlr3 libantlr3c-dev libtool libtool-bin libboost-all-dev python3-pip libfftw3-dev
sudo locale-gen en_US.UTF-8
sudo pip3 install toml
- name: Checkout Challenge Problems
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
GITLAB_USER: ${{ env.GITLAB_USER }}
run: |
export CHALLENGE_DIR=${HOME}/programtargets
git clone https://${GITLAB_USER}:${GITLAB_TOKEN}@gitlab-ext.galois.com/pate/programtargets.git ${CHALLENGE_DIR}
cd tests
make extras
- uses: actions/cache/restore@v4
name: Restore Cabal Cache
id: cache-cabal-pate
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ env.CACHE_VERSION }}-pate-cabal-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze', 'cabal.project') }}
restore-keys: |
${{ env.CACHE_VERSION }}-pate-cabal-${{ runner.os }}-${{ matrix.ghc }}-
- uses: actions/cache/restore@v4
name: Restore Build Cache
id: cache-build-pate
with:
path: dist-newstyle
key: ${{ env.CACHE_VERSION }}-pate-build-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze', 'cabal.project', '.gitmodules') }}
restore-keys: |
${{ env.CACHE_VERSION }}-pate-build-${{ runner.os }}-${{ matrix.ghc }}-
- name: Configure and build Pate dependencies
# installs parameterized-utils and then drops it from the project to resolve issue with bv-sized
run: |
cabal configure pkg:pate --write-ghc-environment-files=always --enable-tests -j --allow-newer=base --enable-documentation -f unsafe-operations
cabal install parameterized-utils --lib
cabal freeze
sed -i -e "/parameterized-utils/d" cabal.project
cabal build pkg:pate --only-dependencies
# Note that these keys still use the old hashes for cabal.project and cabal.project.freeze
- uses: actions/cache/save@v4
name: Save Cabal Cache
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ steps.cache-cabal-pate.outputs.cache-primary-key }}
- uses: actions/cache/save@v4
name: Save Build Cache
with:
path: dist-newstyle
key: ${{ steps.cache-build-pate.outputs.cache-primary-key }}
- name: Build Pate
run: cabal build pkg:pate
- name: Install Solvers
run: .github/ci.sh install_system_deps
env:
Z3_VERSION: "4.8.8"
YICES_VERSION: "2.6.2"
CVC4_VERSION: "4.1.8"
- name: Test
if: runner.os == 'Linux'
run: |
cabal test pkg:pate --test-options="-t 2400s"
- name: Docs
run: cabal haddock pkg:pate