Skip to content

Commit 5160710

Browse files
rv-jenkinsttuegel
andauthored
Update dependency: deps/k_release
* deps/k_release: v5.0.0-4e7c3d0 * deps/k_release: v5.0.0-89fed2e * include.mk: Don't delete kore-expand-macros * test: Remove obsolete references to domains.k * deps/k_release: v5.0.0-62ed02e * Dockerfile: Use K release * Dockerfile: Remove Z3, HLint, and stylish-haskell Z3 should now be provided by the K Framework Docker image. HLint and stylish-haskell checks are not run on Jenkins anymore, but on GitHub Actions. * Check with stylish-haskell for Test workflow * Check that stack.yaml.lock is up-to-date in Test workflow * include.mk: Do not install our own K * deps/k_release: v5.0.0-95b467b * deps/k_release: v5.0.0-c305b58 * Jenkinsfile: Check phase runs on GitHub now * test: make golden * include.mk: Run kore-exec with --no-bug-report * Add Docker scripts Co-authored-by: Thomas Tuegel <thomas.tuegel@runtimeverification.com>
1 parent c427819 commit 5160710

File tree

22 files changed

+105
-130
lines changed

22 files changed

+105
-130
lines changed

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ jobs:
116116
path: ${{ steps.locate-stack-root.outputs.stack-root }}
117117
key: ${{ runner.os }}-ghc-8.10.1-${{ hashFiles('stack.yaml.lock') }}
118118

119+
- name: Build dependencies
120+
run: |
121+
stack build --only-dependencies
122+
if [ ! $(git status --porcelain | wc -l) -eq 0 ]; then
123+
git diff
124+
exit 1
125+
fi
126+
119127
- name: Build project
120128
run: stack build --pedantic
121129

@@ -134,3 +142,29 @@ jobs:
134142

135143
- name: Run hlint
136144
run: curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s kore -j
145+
146+
stylish-haskell:
147+
name: 'stylish-haskell'
148+
runs-on: ubuntu-latest
149+
steps:
150+
- name: Install stylish-haskell
151+
run: |
152+
cd $(mktemp -d)
153+
wget https://github.com/jaspervdj/stylish-haskell/releases/download/v0.11.0.0/stylish-haskell-v0.11.0.0-linux-x86_64.tar.gz
154+
tar xaf stylish-haskell-v0.11.0.0-linux-x86_64.tar.gz
155+
sudo mv stylish-haskell-v0.11.0.0-linux-x86_64/stylish-haskell /usr/local/bin/
156+
stylish-haskell --version
157+
158+
- uses: actions/checkout@v2.3.4
159+
with:
160+
submodules: recursive
161+
162+
- name: Format with stylish-haskell
163+
run: stylish-haskell -i -r kore
164+
165+
- name: Check for changes
166+
run: |
167+
if [ ! $(git status --porcelain | wc -l) -eq 0 ]; then
168+
git diff
169+
exit 1
170+
fi

Dockerfile

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:bionic
1+
ARG K_COMMIT
2+
FROM runtimeverificationinc/kframework-k:ubuntu-bionic-${K_COMMIT}
23

34
ENV TZ=America/Chicago
45
RUN ln --symbolic --no-dereference --force /usr/share/zoneinfo/$TZ /etc/localtime \
@@ -7,47 +8,22 @@ RUN ln --symbolic --no-dereference --force /usr/share/zoneinfo/$TZ /etc/local
78
RUN apt update \
89
&& apt upgrade --yes \
910
&& apt install --yes \
10-
bison curl flex gcc git jq \
11-
make openjdk-8-jdk pandoc \
1211
libtinfo-dev \
13-
python3 python-pygments python-recommonmark python-sphinx \
14-
time unzip wget
12+
curl git make unzip
1513

16-
RUN update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
14+
ENV LC_ALL=C.UTF-8
1715

1816
ARG USER_ID=1000
1917
ARG GROUP_ID=1000
2018
RUN groupadd --gid $GROUP_ID user \
2119
&& useradd --create-home --uid $USER_ID --shell /bin/sh --gid user user
2220

23-
ADD scripts/install-stack.sh /home/user/.install-stack/
24-
RUN /home/user/.install-stack/install-stack.sh
21+
ARG STACK=2.5.1
22+
RUN curl -sSL https://raw.githubusercontent.com/commercialhaskell/stack/v$STACK/etc/scripts/get-stack.sh | sh
2523

2624
USER $USER_ID:$GROUP_ID
25+
WORKDIR /home/user
2726

28-
ENV LC_ALL=C.UTF-8
29-
30-
ARG Z3=4.8.8
31-
RUN cd /home/user \
32-
&& wget https://github.com/Z3Prover/z3/releases/download/z3-$Z3/z3-$Z3-x64-ubuntu-16.04.zip \
33-
&& unzip z3-$Z3-x64-ubuntu-16.04.zip \
34-
&& rm z3-$Z3-x64-ubuntu-16.04.zip \
35-
&& mv z3-$Z3-x64-ubuntu-16.04 z3
36-
ENV PATH=/home/user/z3/bin:$PATH
37-
38-
ARG HLINT=3.2
39-
RUN cd /home/user \
40-
&& curl https://github.com/ndmitchell/hlint/releases/download/v$HLINT/hlint-$HLINT-x86_64-linux.tar.gz -sSfL | tar xzf - \
41-
&& mv hlint-$HLINT hlint
42-
ENV PATH=/home/user/hlint:$PATH
43-
44-
ARG STYLISH_HASKELL=0.11.0.0
45-
RUN cd /home/user \
46-
&& curl https://github.com/jaspervdj/stylish-haskell/releases/download/v$STYLISH_HASKELL/stylish-haskell-v$STYLISH_HASKELL-linux-x86_64.tar.gz -sSfL | tar xzf - \
47-
&& mv stylish-haskell-v$STYLISH_HASKELL-linux-x86_64 stylish-haskell
48-
ENV PATH=/home/user/stylish-haskell:$PATH
49-
50-
ADD --chown=user:user stack.yaml /home/user/.tmp-haskell/
51-
ADD --chown=user:user kore/package.yaml /home/user/.tmp-haskell/kore/
52-
RUN cd /home/user/.tmp-haskell \
53-
&& stack build --only-snapshot --test --bench --haddock
27+
ADD --chown=user:user stack.yaml .tmp-haskell/
28+
ADD --chown=user:user kore/package.yaml .tmp-haskell/kore/
29+
RUN cd .tmp-haskell && stack build --only-snapshot --test --bench --haddock

Jenkinsfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
pipeline {
22
agent {
33
dockerfile {
4-
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
4+
label 'docker'
5+
additionalBuildArgs '--build-arg K_COMMIT=$(cat deps/k_release | cut --delimiter="-" --field="2") --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
56
}
67
}
78
options {
@@ -19,13 +20,6 @@ pipeline {
1920
}
2021
}
2122
}
22-
stage('Check') {
23-
steps {
24-
sh '''
25-
./scripts/check.sh
26-
'''
27-
}
28-
}
2923
stage('Dependencies') {
3024
steps {
3125
sh '''

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,16 @@ in addition to the requirements and recommendations below.
5252
For integration testing, we require:
5353

5454
- GNU [make]
55-
- The [K Framework] frontend, or [curl] to fetch an appropriate version.
56-
The frontend has other dependencies, most notably a Java runtime.
55+
- The [K Framework] frontend.
56+
57+
Instead of installing the frontend, you can use our `Dockerfile`
58+
to run the integration tests inside a container.
59+
Use `docker.sh` to run commands inside the container:
60+
61+
``` sh
62+
./docker/build.sh # run once when dependencies change
63+
./docker/run.sh make ...
64+
```
5765

5866
### Recommended dependencies
5967

deps/k_release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v5.0.0-2440f2e
1+
v5.0.0-c305b58

docker/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
docker build --build-arg K_COMMIT=$(cat deps/k_release | cut --delimiter="-" --field="2") --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) -t kore .

docker/run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
# Run command in Docker
3+
docker run --rm --mount src=$(pwd),target=/home/user/kore,type=bind --workdir=/home/user/kore kore "$@"

include.mk

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,13 @@ export TOP # so that sub-makes do not invoke git again
1111
UPSTREAM_BRANCH = origin/master
1212

1313
BUILD_DIR = $(TOP)/.build
14-
K_RELEASE_TAR = $(BUILD_DIR)/k-nightly.tar.gz
15-
K_RELEASE_TAR_URL = https://github.com/kframework/k/releases/download/$(shell cat $(TOP)/deps/k_release)/k-nightly.tar.gz
16-
K_RELEASE_DEFAULT = $(BUILD_DIR)/k
17-
K_RELEASE ?= $(K_RELEASE_DEFAULT)
18-
K_RELEASE_BIN = $(K_RELEASE)/bin
19-
K_RELEASE_LIB = $(K_RELEASE)/lib
2014

2115
# The kernel JAR is used as a build timestamp.
22-
K = $(K_RELEASE_LIB)/kframework/java/kernel-1.0-SNAPSHOT.jar
23-
KOMPILE = $(K_RELEASE_BIN)/kompile
24-
KRUN = $(K_RELEASE_BIN)/krun
16+
KOMPILE = kompile
17+
KRUN = krun
2518
export KRUN
26-
KPROVE = $(K_RELEASE_BIN)/kprove
27-
KBMC = $(K_RELEASE_BIN)/kbmc
19+
KPROVE = kprove
20+
KBMC = kbmc
2821

2922
KOMPILE_OPTS = --backend haskell
3023
KRUN_OPTS = --haskell-backend-command $(KORE_EXEC)
@@ -34,8 +27,6 @@ export KPROVE_OPTS
3427
KPROVE_REPL_OPTS = --haskell-backend-command $(KORE_REPL)
3528
export KPROVE_REPL_OPTS
3629

37-
HS_TOP = $(TOP)/kore
38-
HS_SOURCE_DIRS = $(HS_TOP)/src $(HS_TOP)/app $(HS_TOP)/test $(HS_TOP)/bench
3930
STACK_BUILD = build --pedantic $(STACK_BUILD_OPTS)
4031

4132
STACK = stack --allow-different-user
@@ -48,7 +39,7 @@ export KORE_PARSER
4839
export KORE_PARSER_OPTS
4940

5041
KORE_EXEC = $(BUILD_DIR)/kore/bin/kore-exec
51-
KORE_EXEC_OPTS =
42+
KORE_EXEC_OPTS = --no-bug-report
5243
export KORE_EXEC
5344
export KORE_EXEC_OPTS
5445

@@ -65,14 +56,3 @@ $(KORE_REPL):
6556

6657
$(KORE_PARSER):
6758
$(STACK) $(STACK_BUILD) $(STACK_NO_PROFILE) --copy-bins kore:exe:kore-parser
68-
69-
$(K_RELEASE_DEFAULT)/lib/kframework/java/kernel-1.0-SNAPSHOT.jar:
70-
mkdir -p $(BUILD_DIR)
71-
rm -rf $(K_RELEASE_DEFAULT) $(K_RELEASE_TAR)
72-
curl --location --output $(K_RELEASE_TAR) $(K_RELEASE_TAR_URL)
73-
mkdir -p $(K_RELEASE_DEFAULT)
74-
tar --extract --file $(K_RELEASE_TAR) --strip-components 1 --directory $(K_RELEASE_DEFAULT)
75-
cp $(TOP)/src/main/kore/prelude.kore $(K_RELEASE_DEFAULT)/include/kore
76-
rm $(K_RELEASE_DEFAULT)/bin/kore*
77-
$(KRUN) --version
78-
test -f $@

scripts/check.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

scripts/install-stack.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)