Skip to content

Commit

Permalink
cmake: make preset build dirs consistent with names (#115)
Browse files Browse the repository at this point in the history
This removes the  retention inputs and always build packages.
Which should allow us to catch packaging errors or debug CI issues which are hard to reproduce.
  • Loading branch information
MariusBgm authored Sep 23, 2024
1 parent 9f323b4 commit 1628183
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 183 deletions.
44 changes: 6 additions & 38 deletions .github/actions/build-cmake-preset/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,9 @@ inputs:
preset-name:
description: "The preset name from CMakePresets.json."
required: true
upload-testlog:
description: "Upload gtest log with same name as preset-name"
required: false
default: true
type: boolean
cmake-args:
description: "Additional CMake arguments"
required: false
do-package-symbols:
description: "In Debug builds, split symbols and provide a zip package"
required: false
type: boolean
do-package:
description: "Run `cmake --target package` and upload artifact"
required: false
type: boolean
retention-days:
description: "How long we keep the artifacts"
required: false
type: number
default: 14
run-tests:
description: "Run tests"
required: false
Expand All @@ -41,10 +23,10 @@ inputs:
default: "x64"
description: "MSVC build architecture to use"
required: false
testlog-name:
artifact-label:
type: string
default: ""
description: "Name of the testlog to upload"
description: "Name of the artifact label to attach to uploads"
required: true

outputs:
Expand Down Expand Up @@ -107,39 +89,25 @@ runs:
shell: bash

- name: stash test reports ${{ inputs.preset-name }}
if: ${{ (inputs.upload-testlog == 'true') && (inputs.testlog-name != '') }}
uses: actions/upload-artifact@v4
with:
name: "${{ inputs.testlog-name }}-test-results"
name: "${{ inputs.artifact-label }}-test-results"
path: '_build/**/*gtestresults.xml'
retention-days: ${{ inputs.retention-days }}
retention-days: 2

- name: create cmake package for ${{ inputs.preset-name }}
if: ${{ inputs.do-package == 'true' }}
id: cmake-package
run: |
cmake --build --preset ${{ inputs.preset-name }} --target package
echo "package-name=$(basename _build/${{inputs.preset-name}}/_CPack_Packages/*/ZIP/SilKit-*-*/)" >> $GITHUB_OUTPUT
echo "package-name=$(basename _build/${{inputs.preset-name}}/_CPack_Packages/*/ZIP/SilKit-*-*/)-${{ inputs.artifact-label }}" >> $GITHUB_OUTPUT
# keep our original zip, otherwise the execute bits are lost
echo "package-path=$(echo _build/${{inputs.preset-name}}/_CPack_Packages/*/ZIP/SilKit-*-*.zip)" >> $GITHUB_OUTPUT
echo "symbols-package-name=$(basename _build/${{inputs.preset-name}}/SilKit-*-*-SYMBOLS.zip)" >> $GITHUB_OUTPUT
echo "symbols-package-path=$(echo _build/${{inputs.preset-name}}/SilKit-*-*-SYMBOLS.zip)" >> $GITHUB_OUTPUT
shell: bash

- name: upload package ${{ inputs.preset-name }}
if: ${{ inputs.do-package == 'true' }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.cmake-package.outputs.package-name }}
path: ${{ steps.cmake-package.outputs.package-path }}
if-no-files-found: 'error'
retention-days: ${{ inputs.retention-days }}

- name: upload symbols package ${{ inputs.preset-name }}
if: ${{ inputs.do-package-symbols == 'true' }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.cmake-package.outputs.symbols-package-name }}
path: ${{ steps.cmake-package.outputs.symbols-package-path}}
if-no-files-found: 'error'
retention-days: ${{ inputs.retention-days }}
retention-days: 2
20 changes: 3 additions & 17 deletions .github/workflows/build-linux-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@ name: 'Linux Release Builds For ARM64'
on:
workflow_call:
inputs:
do_package:
required: false
type: boolean
default: false
do_package_symbols:
required: false
type: boolean
default: false
retention_days:
required: false
type: number
default: 14
run_build:
required: true
type: boolean
Expand All @@ -26,20 +14,18 @@ jobs:
- cc: clang-18
cxx: clang++-18
name: ${{ matrix.toolchain.cc }} release Builds for Ubuntu ARM64
environment: public-github-runners

runs-on: [ ubuntu-24.04arm-8core ]
container:
image: ghcr.io/vectorgrp/sil-kit-docker-build/sil-kit-ci-public-runner:main
if: inputs.run_build == true
if: (inputs.run_build == true) || (github.event_name == 'push')
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/build-cmake-preset
with:
preset-name: linux-release
do-package: ${{ inputs.do_package }}
retention-days: ${{ inputs.retention_days }}
cmake-args: "-DCMAKE_C_COMPILER=${{ matrix.toolchain.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.toolchain.cxx }}"
testlog-name: ${{ github.job }}
artifact-label: ${{ github.job }}
20 changes: 3 additions & 17 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@ name: 'Linux Release Builds'
on:
workflow_call:
inputs:
do_package:
required: false
type: boolean
default: false
do_package_symbols:
required: false
type: boolean
default: false
retention_days:
required: false
type: number
default: 14
run_build:
required: true
type: boolean
Expand All @@ -28,20 +16,18 @@ jobs:
- cc: gcc
cxx: g++
name: ${{ matrix.toolchain.cc }} release Builds for Ubuntu
environment: public-github-runners

runs-on: ubuntu-latest
container:
image: ghcr.io/vectorgrp/sil-kit-docker-build/sil-kit-ci-public-runner:main
if: inputs.run_build == true
if: (inputs.run_build == true) || (github.event_name == 'push')
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/build-cmake-preset
with:
preset-name: linux-release
do-package: ${{ inputs.do_package }}
retention-days: ${{ inputs.retention_days }}
cmake-args: "-DCMAKE_C_COMPILER=${{ matrix.toolchain.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.toolchain.cxx }}"
testlog-name: "${{ github.job }}-${{ matrix.toolchain.cc }}"
artifact-label: "${{ github.job }}-${{ matrix.toolchain.cc }}"
20 changes: 2 additions & 18 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,12 @@ name: macOS build

on:
workflow_call:
inputs:
do_package:
required: false
type: boolean
default: false
do_package_symbols:
required: false
type: boolean
default: false
retention_days:
required: false
type: number
default: 14

jobs:
build-macos:
if: ${{ false }} #disabled for now
runs-on: macos-latest
environment: public-github-runners

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -29,7 +16,4 @@ jobs:
- uses: ./.github/actions/build-cmake-preset
with:
preset-name: clang-release
do_package: ${{ inputs.do_package }}
do_package_symbols: ${{ inputs.do_package_symbols }}
retention_days: ${{ inputs.retention_days }}
testlog-name: ${{ github.job }}
artifact-label: ${{ github.job }}
2 changes: 1 addition & 1 deletion .github/workflows/build-mingw64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
gcc13-release:
name: GCC 13.2 release Builds for mingw64
environment: public-github-runners

runs-on: windows-latest
if: inputs.run_build == true
steps:
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ on:
required: false
type: boolean
default: false
retention_days:
required: false
type: number
default: 14
run_build:
required: true
type: boolean
Expand All @@ -29,8 +25,8 @@ concurrency:
jobs:
build-win-x64:
runs-on: windows-2019
environment: public-github-runners
if: inputs.run_build == true

if: (inputs.run_build == true) || (github.event_name == 'push')
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -39,14 +35,12 @@ jobs:
- uses: ./.github/actions/build-cmake-preset
with:
preset-name: vs141-x64-release
do-package: ${{ inputs.do_package }}
retention-days: ${{ inputs.retention_days }}
build-arch: x64
testlog-name: ${{ github.job }}
artifact-label: ${{ github.job }}

build-win-x32:
runs-on: windows-2019
environment: public-github-runners

if: inputs.run_build == true
steps:
- uses: actions/checkout@v4
Expand All @@ -56,7 +50,5 @@ jobs:
- uses: ./.github/actions/build-cmake-preset
with:
preset-name: vs141-x86-release
do-package: ${{ inputs.do_package }}
retention-days: ${{ inputs.retention_days }}
build-arch: x86
testlog-name: ${{ github.job }}
artifact-label: ${{ github.job }}
5 changes: 2 additions & 3 deletions .github/workflows/linux-asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ jobs:
runs-on: ubuntu-latest
container:
image: ghcr.io/vectorgrp/sil-kit-docker-build/sil-kit-ci-public-runner:main
if: inputs.run_build == true
if: (inputs.run_build == true) || (github.event_name == 'push')
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/build-cmake-preset
with:
preset-name: clang-relwithdebinfo
do-package: false
cmake-args: "-D SILKIT_ENABLE_ASAN=ON -D SILKIT_BUILD_DASHBOARD=OFF \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18"
testlog-name: ${{ github.job }}
artifact-label: ${{ github.job }}
8 changes: 4 additions & 4 deletions .github/workflows/linux-tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ on:
run_build:
required: true
type: boolean
default: true

push:
branches: [ 'main' ]
branches: [ 'main']

jobs:
clang-tsan:
name: Thread Sanitizer Tests
runs-on: ubuntu-latest
container:
image: ghcr.io/vectorgrp/sil-kit-docker-build/sil-kit-ci-public-runner:main
if: inputs.run_build == true
if: (inputs.run_build == true) || (github.event_name == 'push')
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/build-cmake-preset
with:
preset-name: clang-relwithdebinfo
do-package: false
cmake-args: "-D SILKIT_ENABLE_THREADSAN=ON -D SILKIT_BUILD_DASHBOARD=OFF \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18"
testlog-name: ${{ github.job }}
artifact-label: ${{ github.job }}
5 changes: 2 additions & 3 deletions .github/workflows/linux-ubsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ jobs:
runs-on: ubuntu-latest
container:
image: ghcr.io/vectorgrp/sil-kit-docker-build/sil-kit-ci-public-runner:main
if: inputs.run_build == true
if: (inputs.run_build == true) || (github.event_name == 'push')
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/build-cmake-preset
with:
preset-name: clang-relwithdebinfo
do-package: false
cmake-args: "-D SILKIT_ENABLE_UBSAN=ON -D SILKIT_BUILD_DASHBOARD=OFF \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18"
testlog-name: ${{ github.job }}
artifact-label: ${{ github.job }}
8 changes: 0 additions & 8 deletions .github/workflows/sil-kit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,22 @@ jobs:
uses: ./.github/workflows/build-linux.yml
needs: [check-licenses, check-run-builds, check-formatting]
with:
do_package: ${{ github.event_name == 'push' && true || false }}
retention_days: ${{ github.event_name == 'push' && 90 || 14 }}
run_build: ${{ needs.check-run-builds.outputs.run_builds == 'true' }}

ubuntu-arm-release-builds:
uses: ./.github/workflows/build-linux-arm64.yml
needs: [check-licenses, check-run-builds, check-formatting]
with:
do_package: ${{ github.event_name == 'push' && true || false }}
retention_days: ${{ github.event_name == 'push' && 90 || 14 }}
run_build: ${{ needs.check-run-builds.outputs.run_builds == 'true' }}

windows-release-builds:
uses: ./.github/workflows/build-win.yml
needs: [check-licenses, check-run-builds, check-formatting]
with:
do_package: ${{ github.event_name == 'push' && true || false }}
retention_days: ${{ github.event_name == 'push' && 90 || 14 }}
run_build: ${{ needs.check-run-builds.outputs.run_builds == 'true' }}

mingw-release-builds:
uses: ./.github/workflows/build-mingw64.yml
needs: [check-licenses, check-run-builds, check-formatting]
with:
do_package: ${{ github.event_name == 'push' && true || false }}
retention_days: ${{ github.event_name == 'push' && 90 || 14 }}
run_build: ${{ needs.check-run-builds.outputs.run_builds == 'true' }}
Loading

0 comments on commit 1628183

Please sign in to comment.