Skip to content

Commit 801dd49

Browse files
committed
ci: fix a few things
format all build files add --no-install-recommends to all apt-get install calls
1 parent 30621ff commit 801dd49

File tree

2 files changed

+47
-49
lines changed

2 files changed

+47
-49
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build CI
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: ['main']
66
pull_request:
77
workflow_dispatch:
88

@@ -26,14 +26,14 @@ jobs:
2626
os-version: 2022
2727
environment: mingw
2828
architecture: x86_64
29-
shell: "msys2 {0}"
29+
shell: 'msys2 {0}'
3030

3131
- name: Windows UCRT Release
3232
os: windows
3333
os-version: 2022
3434
environment: ucrt
3535
architecture: ucrt-x86_64
36-
shell: "msys2 {0}"
36+
shell: 'msys2 {0}'
3737

3838
- name: Linux Release
3939
os: ubuntu
@@ -74,17 +74,17 @@ jobs:
7474
steps:
7575
- uses: actions/checkout@v4
7676
with:
77-
fetch-depth: "0"
77+
fetch-depth: '0'
7878

7979
- uses: actions/checkout@v4
80-
name: Checkout OOPetris main repo
80+
name: Checkout OOPetris main repo
8181
with:
82-
fetch-depth: "0"
82+
fetch-depth: '0'
8383
repository: OpenBrickProtocolFoundation/oopetris
8484
ref: main
8585
path: ./oopetris
8686
submodules: false
87-
87+
8888
- name: Setup MSVC (Windows)
8989
if: matrix.config.os == 'windows' && matrix.config.environment == 'msvc'
9090
uses: TheMrMilchmann/setup-msvc-dev@v3
@@ -107,26 +107,25 @@ jobs:
107107
mingw-w64-${{matrix.config.architecture}}-ca-certificates
108108
mingw-w64-${{matrix.config.architecture}}-cmake
109109
git
110-
110+
111111
- name: Setup Clang (Linux)
112112
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true
113113
run: |
114114
wget https://apt.llvm.org/llvm.sh
115115
chmod +x llvm.sh
116116
sudo ./llvm.sh 18
117-
sudo apt-get install libc++-18* libc++abi*18* -y
117+
sudo apt-get install libc++-18* libc++abi*18* -y --no-install-recommends
118118
echo "CC=clang-18" >> "$GITHUB_ENV"
119119
echo "CXX=clang++-18" >> "$GITHUB_ENV"
120120
echo "OBJC=clang-18" >> "$GITHUB_ENV"
121-
122-
121+
123122
- name: Setup GCC (Linux)
124123
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == false
125124
uses: egor-tensin/setup-gcc@v1
126125
with:
127126
version: 14
128127
platform: x64
129-
128+
130129
- name: Setup Clang (MacOS)
131130
if: matrix.config.os == 'macos'
132131
run: |
@@ -143,11 +142,11 @@ jobs:
143142
echo "OBJC_LD=lld" >> "$GITHUB_ENV"
144143
145144
- name: Setup meson (MacOS)
146-
if: matrix.config.os == 'macos'
145+
if: matrix.config.os == 'macos'
147146
run: |
148147
brew update
149148
brew install meson
150-
149+
151150
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
152151
- name: Setup meson
153152
if: matrix.config.os != 'macos'
@@ -158,7 +157,7 @@ jobs:
158157
if: matrix.config.os == 'ubuntu'
159158
run: |
160159
sudo apt-get update
161-
sudo apt-get install ninja-build libreadline-dev -y
160+
sudo apt-get install ninja-build libreadline-dev -y --no-install-recommends
162161
sudo pip install meson --break-system-packages
163162
164163
- name: Fix pkg-config (Windows MSVC)
@@ -169,23 +168,23 @@ jobs:
169168
echo "PKG_CONFIG_PATH=C:/lib/pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Append
170169
171170
- name: Configure
172-
run: |
173-
cd oopetris
174-
meson setup build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} -Donly_build_libs=true ${{ matrix.config.os == 'windows' && '-Db_vscrt=from_buildtype' || '' }} ${{ (matrix.config.os == 'windows' && ( matrix.config.environment == 'mingw' || matrix.config.environment == 'ucrt' )) && '-Dprefix=$RUNNER_TEMP/msys64${MINGW_PREFIX}/' || ''}}
171+
run: |
172+
cd oopetris
173+
meson setup build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} -Donly_build_libs=true ${{ matrix.config.os == 'windows' && '-Db_vscrt=from_buildtype' || '' }} ${{ (matrix.config.os == 'windows' && ( matrix.config.environment == 'mingw' || matrix.config.environment == 'ucrt' )) && '-Dprefix=$RUNNER_TEMP/msys64${MINGW_PREFIX}/' || ''}}
175174
176175
- name: Build and install Libs
177176
if: matrix.config.os != 'ubuntu'
178-
run: |
179-
cd oopetris
180-
meson install -C build
177+
run: |
178+
cd oopetris
179+
meson install -C build
181180
182181
- name: Build and install Libs (Linux)
183182
if: matrix.config.os == 'ubuntu'
184-
run: |
185-
cd oopetris
186-
sudo meson install -C build
183+
run: |
184+
cd oopetris
185+
sudo meson install -C build
187186
188187
- name: Build Wrapper
189-
run: |
190-
meson setup -Dtests=false -Dexample=true build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} ${{ matrix.config.os == 'windows' && '-Db_vscrt=from_buildtype' || '' }}
188+
run: |
189+
meson setup -Dtests=false -Dexample=true build -Dbuildtype=release -Ddefault_library=static -Dclang_libcpp=${{ ( ( matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) || matrix.config.os == 'macos' ) && 'enabled' || 'disabled' }} ${{ matrix.config.os == 'windows' && '-Db_vscrt=from_buildtype' || '' }}
191190
meson compile -C build

.github/workflows/test.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ name: Test CI
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: ['main']
66
pull_request:
77
workflow_dispatch:
88

99
jobs:
1010
test:
11-
name: Run Tests
11+
name: Run Tests
1212
runs-on: ubuntu-24.04
1313
steps:
1414
- uses: actions/checkout@v4
1515
with:
16-
fetch-depth: "0"
16+
fetch-depth: '0'
1717

1818
- uses: actions/checkout@v4
1919
name: Checkout OOPetris main repo
2020
with:
21-
fetch-depth: "0"
21+
fetch-depth: '0'
2222
repository: OpenBrickProtocolFoundation/oopetris
2323
ref: main
2424
path: ./oopetris
@@ -29,10 +29,10 @@ jobs:
2929
wget https://apt.llvm.org/llvm.sh
3030
chmod +x llvm.sh
3131
sudo ./llvm.sh 18
32-
sudo apt-get install libc++-18* libc++abi*18* llvm-18 -y
32+
sudo apt-get install libc++-18* libc++abi*18* llvm-18 -y --no-install-recommends
3333
echo "CC=clang-18" >> "$GITHUB_ENV"
3434
echo "CXX=clang++-18" >> "$GITHUB_ENV"
35-
35+
3636
# NOTE: meson has no dependencies, so --break-system-packages doesn't really break anything!
3737
- name: Setup meson
3838
run: |
@@ -41,20 +41,20 @@ jobs:
4141
- name: Install dependencies
4242
run: |
4343
sudo apt-get update
44-
sudo apt-get install ninja-build valgrind gcovr libcriterion-dev libreadline-dev -y
44+
sudo apt-get install ninja-build valgrind gcovr libcriterion-dev libreadline-dev -y --no-install-recommends
4545
4646
- name: Configure
47-
run: |
48-
cd oopetris
49-
meson setup build -Db_coverage=true -Dbuildtype=debugoptimized -Ddefault_library=shared -Dclang_libcpp=enabled -Donly_build_libs=true -Dprefix=/usr
47+
run: |
48+
cd oopetris
49+
meson setup build -Db_coverage=true -Dbuildtype=debugoptimized -Ddefault_library=shared -Dclang_libcpp=enabled -Donly_build_libs=true -Dprefix=/usr
5050
5151
- name: Build and install Libs
5252
run: |
53-
cd oopetris
54-
sudo meson install -C build
53+
cd oopetris
54+
sudo meson install -C build
5555
5656
- name: Build Wrapper
57-
run: |
57+
run: |
5858
meson setup build -Db_coverage=true -Dbuildtype=debugoptimized -Ddefault_library=shared -Dclang_libcpp=enabled -Dtests=true -Dexample=true -Dprefix=/usr
5959
meson compile -C build
6060
@@ -70,20 +70,19 @@ jobs:
7070
path: ./build/meson-logs/coverage.xml
7171
fail: true
7272
publish: true
73-
coverage-summary-title: "Code Coverage Summary"
73+
coverage-summary-title: 'Code Coverage Summary'
7474
togglable-report: true
7575

7676
- name: Upload test coverage artifacts
7777
uses: actions/upload-artifact@v4
7878
with:
79-
name: Tests coverage artifacts
80-
path: |
81-
./build/meson-logs/coverage.xml
82-
./build/meson-logs/coveragereport/
83-
79+
name: Tests coverage artifacts
80+
path: |
81+
./build/meson-logs/coverage.xml
82+
./build/meson-logs/coveragereport/
8483
8584
- name: Test for leaks with valgrind (Linux)
86-
run: |
87-
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 ./build/example/example r ./tests/files/correct.rec
88-
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 cat ./tests/files/example.rec_text | ./build/example/example w ./test.rec
89-
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 ./build/example/example r ./test.rec
85+
run: |
86+
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 ./build/example/example r ./tests/files/correct.rec
87+
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 cat ./tests/files/example.rec_text | ./build/example/example w ./test.rec
88+
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 ./build/example/example r ./test.rec

0 commit comments

Comments
 (0)