-
-
Notifications
You must be signed in to change notification settings - Fork 40
204 lines (194 loc) · 7.11 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
197
198
199
200
201
202
203
204
on:
# Every pull request
pull_request:
# Pushes into the trunk
# This is important to ensure the trunk is not broken and
# to populate the cache for future PRs.
# See https://github.community/t/actions-cache-cache-not-being-hit-despite-of-being-present/17956/3
push:
branches:
- main
name: build
jobs:
build-mdbook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "0.4.5"
- name: Compile mdBook
run: |
cd docs
mdbook build
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: sbt
# see: https://github.com/actions/runner-images/issues/10788
- uses: sbt/setup-sbt@v1
- name: Check formatting
run: make fmt-check
scaladoc-check:
env:
APALACHE_FATAL_WARNINGS: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
# see: https://github.com/actions/runner-images/issues/10788
- uses: sbt/setup-sbt@v1
- name: Check scaladoc
run: sbt unidoc
compiler-warnings:
env:
APALACHE_FATAL_WARNINGS: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
# see: https://github.com/actions/runner-images/issues/10788
- uses: sbt/setup-sbt@v1
- name: Coursier cache
uses: coursier/cache-action@v6
- name: Set APALACHE_HOME env
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
run: echo "APALACHE_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Build and Unit Test
run: make compile-strict
- name: Cleanup before cache
# See https://www.scala-sbt.org/1.x/docs/GitHub-Actions-with-sbt.html#Caching
shell: bash
run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true
unit-tests:
runs-on: ${{ matrix.operating-system }}
strategy:
# Allows other OS tests to proceed even if one fails
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Coursier cache
uses: coursier/cache-action@v6
- name: Coursier setup
uses: coursier/setup-action@v1
with:
jvm: temurin:1.17
apps: sbt
# see: https://github.com/actions/runner-images/issues/10788
- uses: sbt/setup-sbt@v1
- name: Set APALACHE_HOME env
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
run: echo "APALACHE_HOME=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Build and Unit Test
run: make test
- name: Cleanup before cache
# See https://www.scala-sbt.org/1.x/docs/GitHub-Actions-with-sbt.html#Caching
shell: bash
run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true
integration-tests:
runs-on: ${{ matrix.operating-system }}
strategy:
# Allows other OS tests to proceed even if one fails
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest]
smt-encoding: [oopsla19, arrays]
exclude:
# We don't need an additional run of the arrays encoding just for macos
# since no OS-specific differences seem likely.
- operating-system: macos-latest
smt-encoding: arrays
steps:
- uses: actions/checkout@v4
- name: Cache local m2 repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-sbt-${{ hashFiles('project/Dependencies.scala') }}
restore-keys: |
${{ runner.os }}-sbt-
${{ runner.os }}-
- name: Cache nix store
# Workaround for cache action not playing well with permissions
# See https://github.com/actions/cache/issues/324
uses: john-shaffer/cache@59429c0461095f341a8cf7388e5d3aef37b95edd
with:
path: |
/nix/store
/nix/var/nix/profiles
key: ${{ runner.os }}-nix-${{ hashFiles('**.nix') }}
restore-keys: |
${{ runner.os }}-nix-
${{ runner.os }}-
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Build dev-shell
run: nix develop -c bash -c exit
- name: Build and run integration tests
run: nix develop -c make integration
env:
SMT_ENCODING: ${{ matrix.smt-encoding }}
TEST_FILTER: ${{ matrix.smt-encoding == 'arrays' && 'array-encoding' || '' }}
docker-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# see: https://github.com/actions/runner-images/issues/10788
- uses: sbt/setup-sbt@v1
- name: Cache nix store
# Workaround for cache action not playing well with permissions
# See https://github.com/actions/cache/issues/324
uses: john-shaffer/cache@59429c0461095f341a8cf7388e5d3aef37b95edd
with:
path: |
/nix/store
/nix/var/nix/profiles
key: ${{ runner.os }}-nix-${{ hashFiles('**.nix') }}
restore-keys: |
${{ runner.os }}-nix-
${{ runner.os }}-
- name: Install Nix
uses: cachix/install-nix-action@v22
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Build dev-shell
run: nix develop -c bash -c exit
- name: Build the docker image
run: make docker
- name: Run integration tests in docker container
run: |
nix develop -c bash -c "source ./test/.envrc && test/mdx-test.py --debug"
env:
USE_DOCKER: true
APALACHE_TAG: latest