forked from IntelligentSoftwareSystems/Galois
-
Notifications
You must be signed in to change notification settings - Fork 2
162 lines (151 loc) · 5.13 KB
/
build-and-test.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
name: Docker / Ubuntu 22.04 / Build and Test
run-name: docker-ubuntu-2204 performed by @${{ github.triggering_actor }}
on:
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docker-create-ubuntu-2204:
name: create
runs-on: self-hosted
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Docker Image
timeout-minutes: 45
run: |
make ci-image
ubuntu-2204-docker:
name: gcc / ${{ matrix.build-type }} / ${{ matrix.sanitizer-type }}
runs-on: self-hosted
permissions:
contents: read
packages: write
env:
IMAGE_NAME: galois
CONTAINER_SRC_DIR: "/pando-galois"
CONTAINER_BUILD_DIR: "/pando-galois/build"
CONTAINER_WORK_DIR: "/pando-galois"
GALOIS_CONTAINER_ENV: "-e=GALOIS_BUILD_TOOL=Ninja"
INTERACTIVE: ""
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
build-type: ['Release']
sanitizer-type: ['nosan', 'san']
needs: docker-create-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: 'true'
submodules: recursive
- name: Set up environment variables
timeout-minutes: 1
run: |
echo "UNAME=$(whoami)" >> $GITHUB_ENV
echo "UID=$(id -u)" >> $GITHUB_ENV
echo "GID=$(id -g)" >> $GITHUB_ENV
echo "SRC_DIR=$(pwd)" >> $GITHUB_ENV
echo "GALOIS_CCACHE_DIR=/var/local/$(whoami)/.ccache" >> $GITHUB_ENV
echo "IMAGE_VERSION=$(git log --pretty="%h" -1 Dockerfile)" >> $GITHUB_ENV
if [ ${{ matrix.sanitizer-type }} == 'san' ]; then
echo "GALOIS_CONTAINER_ENV=$GALOIS_CONTAINER_ENV -e=GALOIS_EXTRA_CXX_FLAGS='\"-fsanitize=address -fsanitize=undefined\"'" >> $GITHUB_ENV
fi
if [ ${{ matrix.build-type }} == 'Debug' ]; then
echo "GALOIS_CONTAINER_ENV=$GALOIS_CONTAINER_ENV -e=GALOIS_EXTRA_CXX_FLAGS='-O3'" >> $GITHUB_ENV
fi
if [ ${{ runner.name }} == 'zerberus-0' ]; then
echo "CONTAINER_CPUSET='--cpuset-cpus=0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30'" >> $GITHUB_ENV
fi
if [ ${{ runner.name }} == 'zerberus-1' ]; then
echo "CONTAINER_CPUSET='--cpuset-cpus=1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31'" >> $GITHUB_ENV
fi
if [ ${{ runner.name }} == 'languedoc-0' ]; then
echo "CONTAINER_CPUSET='--cpuset-cpus=0,1,2,3,4,5,6,7,32,33,34,35,36,37,38,39'" >> $GITHUB_ENV
fi
if [ ${{ runner.name }} == 'languedoc-1' ]; then
echo "CONTAINER_CPUSET='--cpuset-cpus=16,17,18,19,20,21,22,23,48,49,50,51,52,53,54,55'" >> $GITHUB_ENV
fi
if [ ${{ runner.name }} == 'languedoc-2' ]; then
echo "CONTAINER_CPUSET='--cpuset-cpus=8,9,10,11,12,13,14,15,40,41,42,43,44,45,46,47'" >> $GITHUB_ENV
fi
if [ ${{ runner.name }} == 'languedoc-3' ]; then
echo "CONTAINER_CPUSET='--cpuset-cpus=24,25,26,27,28,29,30,31,56,57,58,59,60,61,62,63'" >> $GITHUB_ENV
fi
cat $GITHUB_ENV
- name: Configure
timeout-minutes: 10
run: |
mkdir -p ${{ env.GALOIS_CCACHE_DIR }} -m=777
CONTAINER_CMD="bash -lc 'source /opt/intel/oneapi/setvars.sh && make setup-ci'" \
CONTAINER_OPTS="-e=BUILD_TYPE=${{ matrix.build-type }}" \
IMAGE_NAME="${{ env.IMAGE_NAME }}" \
VERSION="${{ env.IMAGE_VERSION }}" \
make docker
- name: Build
timeout-minutes: 15
run: |
CONTAINER_CMD="bash -c 'ninja -j10 || ninja || ninja'" \
IMAGE_NAME="${{ env.IMAGE_NAME }}" \
VERSION="${{ env.IMAGE_VERSION }}" \
CONTAINER_WORKDIR="${{ env.CONTAINER_BUILD_DIR }}" \
make docker
- name: Run Tests
timeout-minutes: 5
run: |
CONTAINER_CMD="make run-tests" \
IMAGE_NAME="${{ env.IMAGE_NAME }}" \
VERSION="${{ env.IMAGE_VERSION }}" \
make docker
docker-pre-commit-ubuntu-2204:
name: pre-commit
runs-on: self-hosted
permissions:
contents: read
packages: write
env:
IMAGE_NAME: galois
CONTAINER_SRC_DIR: "/pando-galois"
CONTAINER_BUILD_DIR: "/pando-galois/build"
CONTAINER_WORK_DIR: "/pando-galois"
INTERACTIVE: ""
defaults:
run:
shell: bash -l {0}
needs: docker-create-ubuntu-2204
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up environment variables
timeout-minutes: 1
run: |
echo "SRC_DIR=$(pwd)" >> $GITHUB_ENV
echo "IMAGE_VERSION=$(git log --pretty="%h" -1 Dockerfile)" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Check pre-commit
timeout-minutes: 10
run: |
IMAGE_NAME="${{ env.IMAGE_NAME }}" \
VERSION="${{ env.IMAGE_VERSION }}" \
make docker-pre-commit