Skip to content

Commit b2d39b0

Browse files
committed
GitHub actions: unify build commands
Use single-instruction commands where possible, making the code use less vertical space (and making different jobs easier to compare).
1 parent 8f82589 commit b2d39b0

File tree

1 file changed

+11
-33
lines changed

1 file changed

+11
-33
lines changed

.github/workflows/pull-request-checks.yaml

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,6 @@ jobs:
164164
cpanm Thread::Pool::Simple
165165
- name: Confirm z3 solver is available and log the version installed
166166
run: z3 --version
167-
- name: Download cvc-5 from the releases page and make sure it can be deployed
168-
run: |
169-
wget -O cvc5 https://github.com/cvc5/cvc5/releases/download/cvc5-${{env.cvc5-version}}/cvc5-Linux
170-
chmod u+x cvc5
171-
mv cvc5 /usr/local/bin
172-
cvc5 --version
173167
- name: Prepare ccache
174168
uses: actions/cache@v3
175169
with:
@@ -186,6 +180,8 @@ jobs:
186180
run: ccache -z --max-size=500M
187181
- name: Build with make
188182
run: make -C src -j2
183+
- name: Print ccache stats
184+
run: ccache -s
189185
- name: Run regression/cbmc tests with z3 as the backend
190186
run: make -C regression/cbmc test-z3
191187

@@ -225,18 +221,13 @@ jobs:
225221
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
226222
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
227223
- name: Configure using CMake
228-
run: |
229-
mkdir build
230-
cd build
231-
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
224+
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
232225
- name: Check that doc task works
233-
run: |
234-
cd build
235-
ninja doc
226+
run: ninja -C build doc
236227
- name: Zero ccache stats and limit in size
237228
run: ccache -z --max-size=500M
238229
- name: Build with Ninja
239-
run: cd build; ninja -j2
230+
run: ninja -C build -j2
240231
- name: Print ccache stats
241232
run: ccache -s
242233
- name: Checking completeness of help output
@@ -285,18 +276,13 @@ jobs:
285276
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
286277
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
287278
- name: Configure using CMake
288-
run: |
289-
mkdir build
290-
cd build
291-
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
279+
run: cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
292280
- name: Check that doc task works
293-
run: |
294-
cd build
295-
ninja doc
281+
run: ninja -C build doc
296282
- name: Zero ccache stats and limit in size
297283
run: ccache -z --max-size=500M
298284
- name: Build with Ninja
299-
run: cd build; ninja -j2
285+
run: ninja -C build -j2
300286
- name: Print ccache stats
301287
run: ccache -s
302288
- name: Check if package building works
@@ -747,14 +733,9 @@ jobs:
747733
- name: Zero ccache stats and limit in size
748734
run: ccache -z --max-size=500M
749735
- name: Configure CMake
750-
run: |
751-
mkdir build
752-
cd build
753-
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -Dsat_impl=cadical
736+
run: cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -Dsat_impl=cadical
754737
- name: Build using Ninja
755-
run: |
756-
cd build
757-
ninja -j2
738+
run: ninja -C build -j2
758739
- name: Print ccache stats
759740
run: ccache -s
760741
- name: Run CTest
@@ -816,10 +797,7 @@ jobs:
816797
sudo apt-get update
817798
sudo apt-get install --no-install-recommends -yq cmake ninja-build gcc gdb g++ maven flex bison iwyu
818799
- name: Configure using CMake
819-
run: |
820-
mkdir build
821-
cd build
822-
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
800+
run: cmake -S . -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
823801
- name: Run include-what-you-use
824802
run: |
825803
iwyu_tool -p build/compile_commands.json -j2 | tee includes.txt

0 commit comments

Comments
 (0)