Skip to content

Commit 0ddc5ce

Browse files
authored
CI: update toolchains to use latest GitHub runner images and rewrite set_matrix.py without polly (#780)
Update all used GitHub runner images (Linux, Windows and Mac) and update the `set_matrix.py` script to work without the `polly` toolchains. - Update from the deprecated ubuntu-20.04 images to the currently latest ubuntu-24.04 image. In the process update the `gcc` version from 7, 8, 9 to 12, 13, 14. - fixes: #778 - Update from the deprecated `windows-2019` image with `vs-16-2019` toolchain to `windows-2022` with `vs-17-2022` toolchain - fixes: #781 - Update from deprecated `macos-12` image to `macos-15` - fixes: #782 - rewrite `set_matrix.py` to generate the `CMAKE_TOOLCHAIN_FILE` from the `toolchain` matrix name - update CI and remove the dependency on the [polly toolchain project](https://github.com/cpp-pm/polly) - remove `analyze` and `sanitize` jobs, no-one looks at them and they are a hassle to implement, PR welcome, but for now removed - remove the `build.sh` and `build.cmd` default build scripts and replace them with a `build.py` python script - remove `build_hunter_tests.sh` build script and use `build.py` there as well - remove unused `jenkins.py` file - update custom `matrix.json` and `build.sh` for the following projects: - `filament` - `pthreads-win32` - `occt` - `freetype-gl` - `Boost`
1 parent 0a7acbe commit 0ddc5ce

File tree

18 files changed

+1117
-803
lines changed

18 files changed

+1117
-803
lines changed

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
toolchains/

.github/workflows/ci.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,27 @@ jobs:
5151
if [ "${MATRIX}" ]; then
5252
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
5353
else
54+
echo "matrix=${MATRIX}"
5455
exit 1
5556
fi
5657
58+
- uses: actions/upload-artifact@v4
59+
with:
60+
name: toolchains
61+
path: .github/toolchains
62+
5763
build:
58-
name: ${{ matrix.example }} ${{ matrix.toolchain }} ${{ matrix.os }}
64+
name: ${{ matrix.project }} ${{ matrix.toolchain }} ${{ matrix.os }}
5965
needs: set_matrix
6066
runs-on: ${{ matrix.os }}
6167
strategy:
6268
fail-fast: false
6369
matrix: ${{ fromJson(needs.set_matrix.outputs.matrix) }}
6470

6571
env:
66-
TOOLCHAIN: ${{ matrix.toolchain }}
67-
PROJECT_DIR: examples/${{ matrix.example }}
72+
TOOLCHAIN: '${{ matrix.toolchain }}'
73+
PROJECT_DIR: ${{ matrix.example }}
74+
SCRIPT: ${{ matrix.script }}
6875
GITHUB_USER_PASSWORD: ${{ secrets.CPP_PM_BOT_TOKEN }}
6976

7077
steps:
@@ -74,6 +81,9 @@ jobs:
7481
with:
7582
submodules: true
7683

84+
- name: Download all workflow run artifacts
85+
uses: actions/download-artifact@v4
86+
7787
- name: Set up Python
7888
uses: actions/setup-python@v5.1.0
7989
with:
@@ -87,26 +97,31 @@ jobs:
8797
if: runner.os == 'Windows'
8898
run: echo "HUNTER_PYTHON_LOCATION=$env:pythonLocation" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
8999

90-
- name: Build hunter_tests Unix
91-
if: runner.os != 'Windows' && matrix.toolchain == 'hunter_tests'
92-
env:
93-
PROJECT_DIR: ${{ matrix.example }}
94-
run: |
95-
bash ${{ matrix.script }}
96-
97100
- name: Build on Unix
98-
if: runner.os != 'Windows' && matrix.toolchain != 'hunter_tests'
101+
if: runner.os != 'Windows'
99102
env:
100103
BRANCH_NAME: ${{ github.ref_name }}
101104
run: |
102-
bash ${{ matrix.script }}
105+
python .github/workflows/ci/build.py
103106
104107
- name: Build on Windows
105108
if: runner.os == 'Windows' && matrix.toolchain != 'hunter_tests'
106109
env:
107110
BRANCH_NAME: ${{ github.ref_name }}
111+
VCVARSALL: ${{ matrix.VCVARSALL }}
112+
VCVARSALL_ARGS: ${{ matrix.VCVARSALL_ARGS }}
108113
run: |
109-
${{ matrix.script }}
114+
if ("$env:VCVARSALL") {
115+
Write-Host "call VCVARSALL using command '${env:VCVARSALL}' and args '${env:VCVARSALL_ARGS}'"
116+
cmd /c 'call "%VCVARSALL%" %VCVARSALL_ARGS% && set' | foreach {
117+
if ($_ -match "=") {
118+
#"processing line: '$_'"
119+
$v = $_.split("=");
120+
set-item -force -path "ENV:\$($v[0])" -value "$($v[1])";
121+
}
122+
}
123+
}
124+
python .github/workflows/ci/build.py
110125
111126
set_status:
112127
needs: [ set_matrix, build ]

.github/workflows/ci/build.cmd

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)