Skip to content

Commit 7754e5f

Browse files
committed
Fix CI warnings
1 parent bf606d6 commit 7754e5f

3 files changed

Lines changed: 46 additions & 55 deletions

File tree

.github/workflows/avr_build_test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
1818

1919
- name: Set up Python
20-
uses: actions/setup-python@v5
20+
uses: actions/setup-python@v6
2121
with:
2222
python-version: '3.10'
2323

@@ -37,4 +37,4 @@ jobs:
3737

3838
- name: Run Simulator Unit Tests
3939
working-directory: ./test/avr
40-
run: platformio test -v -e megaatmega2560_sim_unittest
40+
run: platformio test -v -e megaatmega2560_sim_unittest

.github/workflows/canary_build.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,18 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020

2121
- name: Configure CMake & Build
2222
env:
23-
# Map from C++ compiler to equivalent C compiler
24-
g++: gcc
25-
clang++: clang
26-
uses: threeal/cmake-action@v2.0.0
27-
with:
28-
build-dir: ${{ env.output_folder }}
29-
c-compiler: ${{ env[env.cpp_compiler] }}
30-
cxx-compiler: ${{ env.cpp_compiler }}
31-
build-args: -t tester
32-
options: |
33-
LIBDIVIDE_BUILD_TESTS=ON
34-
CMAKE_BUILD_TYPE=${{ env.build_type }}
23+
C_COMPILER: gcc
24+
run: |
25+
cmake -B "$output_folder" \
26+
"-DCMAKE_C_COMPILER=$C_COMPILER" \
27+
"-DCMAKE_CXX_COMPILER=$cpp_compiler" \
28+
-DLIBDIVIDE_BUILD_TESTS=ON \
29+
"-DCMAKE_BUILD_TYPE=$build_type"
30+
cmake --build "$output_folder" -t tester
3531
3632
- name: Test
3733
working-directory: ${{env.output_folder}}
@@ -45,4 +41,4 @@ jobs:
4541
# Kick off the full build if everything above succeeded
4642
AVR-Build:
4743
needs: Canary-Build
48-
uses: ./.github/workflows/avr_build_test.yml
44+
uses: ./.github/workflows/avr_build_test.yml

.github/workflows/full_build.yml

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,20 @@ jobs:
3232
output_folder: ${{github.workspace}}/build/
3333

3434
steps:
35-
- uses: actions/checkout@v4
35+
- uses: actions/checkout@v5
3636

3737
- name: Configure CMake & Build
3838
env:
39-
# Map from C++ compiler to equivalent C compiler
40-
g++: gcc
41-
clang++: clang
42-
uses: threeal/cmake-action@v2.0.0
43-
with:
44-
build-dir: ${{ env.output_folder }}
45-
c-compiler: ${{ env[matrix.cpp_compiler] }}
46-
cxx-compiler: ${{ matrix.cpp_compiler }}
47-
options: |
48-
LIBDIVIDE_BUILD_TESTS=ON
49-
CMAKE_BUILD_TYPE=${{ matrix.build_type }}
50-
build-args: --config ${{ matrix.build_type }}
39+
C_COMPILER: ${{ matrix.cpp_compiler == 'g++' && 'gcc' || 'clang' }}
40+
CXX_COMPILER: ${{ matrix.cpp_compiler }}
41+
BUILD_TYPE: ${{ matrix.build_type }}
42+
run: |
43+
cmake -B "$output_folder" \
44+
"-DCMAKE_C_COMPILER=$C_COMPILER" \
45+
"-DCMAKE_CXX_COMPILER=$CXX_COMPILER" \
46+
-DLIBDIVIDE_BUILD_TESTS=ON \
47+
"-DCMAKE_BUILD_TYPE=$BUILD_TYPE"
48+
cmake --build "$output_folder" --config "$BUILD_TYPE"
5149
5250
- name: Test
5351
working-directory: ${{ env.output_folder }}
@@ -93,30 +91,27 @@ jobs:
9391
output_folder: ${{github.workspace}}/build/
9492

9593
steps:
96-
- uses: actions/checkout@v4
97-
- uses: ilammy/msvc-dev-cmd@v1
94+
- uses: actions/checkout@v5
9895

99-
- name: Configure CMake & Build
96+
- name: Configure CMake, Build & Test
10097
env:
101-
# Map from C++ compiler to equivalent C compiler
102-
cl.exe: cl.exe
103-
clang-cl.exe: clang-cl.exe
104-
toolset: ${{ matrix.toolset && format('-T {0}', matrix.toolset) || ''}}
105-
uses: threeal/cmake-action@v2.0.0
106-
with:
107-
build-dir: ${{ env.output_folder }}
108-
c-compiler: ${{ env[matrix.cpp_compiler] }}
109-
cxx-compiler: ${{ matrix.cpp_compiler }}
110-
generator: ${{ matrix.generator }}
111-
args: ${{ env.toolset }}
112-
options: |
113-
LIBDIVIDE_BUILD_TESTS=ON
114-
CMAKE_BUILD_TYPE=${{ matrix.build_type }}
115-
${{ matrix.build_type == 'Sanitize' && 'LIBDIVIDE_ENABLE_SANITIZERS=ON' || '' }}
116-
build-args: --config ${{ matrix.build_type }}
117-
118-
- name: Test
119-
working-directory: ${{ env.output_folder }}
120-
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
121-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
122-
run: ctest --build-config ${{ matrix.build_type }} --verbose
98+
SANITIZER_OPTION: ${{ matrix.build_type == 'Sanitize' && '-DLIBDIVIDE_ENABLE_SANITIZERS=ON' || '' }}
99+
TOOLSET_ARGS: ${{ matrix.toolset && format('-T {0}', matrix.toolset) || '' }}
100+
shell: cmd
101+
run: |
102+
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products * -latest -prerelease -property installationPath`) do set "VS_INSTALL_PATH=%%i"
103+
if not defined VS_INSTALL_PATH exit /b 1
104+
call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
105+
if errorlevel 1 exit /b 1
106+
cmake -B "%output_folder%" ^
107+
-G "${{ matrix.generator }}" ^
108+
-DCMAKE_C_COMPILER=${{ matrix.cpp_compiler }} ^
109+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} ^
110+
-DLIBDIVIDE_BUILD_TESTS=ON ^
111+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^
112+
%SANITIZER_OPTION% %TOOLSET_ARGS%
113+
if errorlevel 1 exit /b 1
114+
cmake --build "%output_folder%" --config ${{ matrix.build_type }}
115+
if errorlevel 1 exit /b 1
116+
cd /d "%output_folder%"
117+
ctest --build-config ${{ matrix.build_type }} --verbose

0 commit comments

Comments
 (0)