-
Notifications
You must be signed in to change notification settings - Fork 150
149 lines (145 loc) · 5.43 KB
/
test-pr-macos.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
name: "Test PR on MacOS"
on:
pull_request:
types: [opened, edited, reopened, synchronize]
branches:
- "develop"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
version-sync:
name: "Version Sync"
runs-on: ubuntu-20.04
steps:
- name: "Check out code"
uses: actions/checkout@v3
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
# fetch-depth 0 means deep clone the repo
fetch-depth: 0
- name: "Update Version"
run: |
set -x
git config user.name devops
git config user.email [email protected]
./package/version.sh sub
if git add --update && git commit --message "Set Version: $(cat package/version)"; then
git push origin HEAD:${GITHUB_HEAD_REF}
fi
nix-maven:
name: "Maven Build"
strategy:
fail-fast: false
matrix:
include:
- runner: macos-13
os: macos-13
- runner: MacM1
os: self-macos-12
runs-on: ${{ matrix.runner }}
needs: version-sync
steps:
- name: "Check out code, set up Git"
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: "Upgrade bash"
if: ${{ contains(matrix.os, 'macos') }}
run: brew install bash
- name: "Install Dependencies"
run: brew install bison boost cmake flex fmt gcc gmp openjdk jemalloc libyaml llvm@15 make maven mpfr pkg-config python stack zlib z3
- name: "Install and set up direnv"
run: |
set -euxo pipefail
brew install direnv
cp macos-envrc .envrc
eval "$(direnv hook bash)"
direnv allow .
echo $(which llvm-config)
- name: "Build K from Source"
run: |
set -euxo pipefail
mvn package
test-k:
name: "K Tests"
strategy:
fail-fast: false
matrix:
include:
- runner: macos-13
os: macos-13
- runner: MacM1
os: self-macos-12
runs-on: ${{ matrix.runner }}
needs: version-sync
steps:
- name: "Check out code"
uses: actions/checkout@v3
with:
submodules: recursive
- name: "Build and Test K"
run: mvn verify --batch-mode -U
- name: "Check out k-exercises"
uses: actions/checkout@v3
with:
repository: runtimeverification/k-exercises
token: ${{ secrets.JENKINS_GITHUB_PAT }}
submodules: recursive
path: k-exercises
- name: "Tutorial Integration Tests"
run: |
k-distribution/target/release/k/bin/spawn-kserver kserver.log
cd k-exercises/tutorial && make -j`nproc` --output-sync
cd ../../k-distribution/k-tutorial/1_basic && ./test_kompile.sh'
cd ../2_intermediate && ./test_kompile.sh'
# performance-tests:
# name: 'Performace Tests'
# runs-on: [self-hosted, linux, performance]
# needs: test-package-ubuntu-jammy
# steps:
# - uses: actions/checkout@v3
# - name: 'Download K package from the Summary Page'
# uses: actions/download-artifact@v3
# with:
# name: kframework.deb
# - name: 'Set up Docker Test Image'
# env:
# BASE_OS: ubuntu
# BASE_DISTRO: jammy
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
# BENCHER_PROJECT: k-framework
# BENCHER_ADAPTER: json
# run: |
# set -euxo pipefail
# workspace=$(pwd)
# docker run --name k-profiling-tests-${GITHUB_SHA} \
# --rm -it --detach \
# -e BENCHER_API_TOKEN=$BENCHER_API_TOKEN \
# -e BENCHER_PROJECT=$BENCHER_PROJECT \
# -e BENCHER_ADAPTER=$BENCHER_ADAPTER \
# -e GITHUB_HEAD_REF=$GITHUB_HEAD_REF \
# -e GITHUB_BASE_REF=$GITHUB_BASE_REF \
# -e GITHUB_TOKEN=$GITHUB_TOKEN \
# -e GITHUB_ACTIONS=true \
# -e GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME \
# -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
# -e GITHUB_REF=$GITHUB_REF \
# --workdir /opt/workspace \
# -v "${workspace}:/opt/workspace" \
# ${BASE_OS}:${BASE_DISTRO}
# - name: 'Install K from Package'
# run: |
# set -euxo pipefail
# docker exec -t k-profiling-tests-${GITHUB_SHA} /bin/bash -c './k-distribution/tests/profiling/setup_profiling.sh'
# - name: 'Profiling Performance Tests'
# run: |
# set -euxo pipefail
# docker exec -t k-profiling-tests-${GITHUB_SHA} /bin/bash -c 'cd k-distribution/tests/profiling && make'
# - name: 'Tear down Docker'
# if: always()
# run: |
# docker stop --time=0 k-profiling-tests-${GITHUB_SHA}
# docker container rm --force k-profiling-tests-${GITHUB_SHA} || true