Skip to content

Commit

Permalink
ci-staging: split build action
Browse files Browse the repository at this point in the history
  • Loading branch information
VDanielEdwards committed Jul 9, 2024
1 parent 872d1cc commit a58e056
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 6 deletions.
75 changes: 75 additions & 0 deletions .github/actions/sil-kit-ci/configure-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: (sil-kil ci) configure build

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
default: true
type: boolean
toolset:
type: string
default: '14.1'
description: "MSVC tool set to use"
required: false
build-arch:
type: string
default: "x64"
description: "MSVC build architecture to use"
required: false
linux-docker-image:
type: string
default: ghcr.io/mariusbgm/sil-kit-ci-ubuntu-22.04:main
description: "Docker image used under Linux"
required: false

outputs:
package-name:
description: artifact name of the distribution zip
value: "${{ steps.cmake-package.outputs.package-name }}"
package-path:
description: file path of the distribution zip
value: "${{ steps.cmake-package.outputs.package-path }}"
symbols-package-path:
description: file path of the symbols zip
value: "${{ steps.cmake-package.outputs.symbols-package-path }}"
symbols-package-name:
description: artifact name of the symbols zip
value: "${{ steps.cmake-package.outputs.symbols-package-name }}"

runs:
using: composite
steps:

- name: (linux) configure cmake preset
run: |
docker run \
-v "${{ github.workspace }}/s/sil-kit:/s" \
-v "${{ github.workspace }}/b/linux:/b" \
"${{ inputs.linux-docker-image }}" \
gcc --version
if: runner.os == 'Linux'
shell: bash
82 changes: 82 additions & 0 deletions .github/actions/sil-kit-ci/setup-build-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: (sil-kit ci) setup build environment

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
default: true
type: boolean
toolset:
type: string
default: '14.1'
description: "MSVC tool set to use"
required: false
build-arch:
type: string
default: "x64"
description: "MSVC build architecture to use"
required: false
linux-docker-image:
type: string
default: ghcr.io/mariusbgm/sil-kit-ci-ubuntu-22.04:main
description: "Docker image used under Linux"
required: false

outputs:
package-name:
description: artifact name of the distribution zip
value: "${{ steps.cmake-package.outputs.package-name }}"
package-path:
description: file path of the distribution zip
value: "${{ steps.cmake-package.outputs.package-path }}"
symbols-package-path:
description: file path of the symbols zip
value: "${{ steps.cmake-package.outputs.symbols-package-path }}"
symbols-package-name:
description: artifact name of the symbols zip
value: "${{ steps.cmake-package.outputs.symbols-package-name }}"

runs:
using: composite
steps:

- name: (all) checkout sil-kit sources
uses: actions/checkout@v4
with:
path: s/sil-kit
submodules: true

- name: (linux) create build directory
run: mkdir -p b/linux
if: runner.os == 'Linux'
shell: bash

- name: (linux) pull docker image for building via cmake
run: docker pull "${{ inputs.linux-docker-image }}"
if: runner.os == 'Linux'
shell: bash

24 changes: 18 additions & 6 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,30 @@ on:

jobs:
ci-testing:
name: CI Testing
name: Linux Build
environment: public-github-runners
runs-on: ubuntu-22.04
if: inputs.run_build == true
steps:
- name: git checkout
uses: actions/checkout@v1

- name: checkout sil-kit workflows and actions
uses: actions/checkout@v4
sparse-checkout: |
.github
with:
submodules: true
- name: GCC release build
uses: ./.github/actions/build-cmake-preset
id: build

- name: setup build environment
uses: ./.github/actions/sil-kit-ci/setup-build-environment
id: setup-build-environment
with:
preset-name: linux-release
do-package: ${{ inputs.do_package }}
retention-days: ${{ env.retention_days }}

- name: configure build
uses: ./.github/actions/sil-kit-ci/configure-build
id: configure-build
with:
preset-name: linux-release
do-package: ${{ inputs.do_package }}
Expand Down

0 comments on commit a58e056

Please sign in to comment.