Skip to content

Commit

Permalink
ci-staging: create overarching ci run action
Browse files Browse the repository at this point in the history
  • Loading branch information
VDanielEdwards committed Jul 9, 2024
1 parent acd6f56 commit 6576c9e
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/actions/sil-kit-ci/cmake-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runs:
using: composite
steps:

- name: (linux) build cmake preset
- name: (linux) build cmake project
if: runner.os == 'Linux'
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/sil-kit-ci/cmake-configure/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runs:
using: composite
steps:

- name: (linux) configure cmake preset
- name: (linux) configure cmake project
if: runner.os == 'Linux'
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/sil-kit-ci/cmake-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runs:
using: composite
steps:

- name: (linux) build cmake preset
- name: (linux) package cmake project
if: runner.os == 'Linux'
shell: bash
run: |
Expand Down
69 changes: 69 additions & 0 deletions .github/actions/sil-kit-ci/run/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: sil-kit-ci/run

description: Run the SIL Kit CI builds.

inputs:

preset-name:
description: The preset name from CMakePresets.json
required: true

linux-docker-image:
description: Docker image used under Linux
required: false
default: ghcr.io/mariusbgm/sil-kit-ci-ubuntu-22.04:main

runs:
using: composite
steps:

- name: (all) compute directories
id: dirs
if: runner.os == 'Linux'
shell: bash
run: |
echo 'cmake-source=${{ github.workspace}}/s/sil-kit' >> "$GITHUB_OUTPUT"
echo 'cmake-build=${{ github.workspace}}/b/sil-kit/${{ inputs.preset-name }}' >> "$GITHUB_OUTPUT"
echo 'cmake-package=${{ github.workspace}}/p/sil-kit/${{ inputs.preset-name }}' >> "$GITHUB_OUTPUT"
- name: setup
uses: ./.github/actions/sil-kit-ci/setup
id: setup
with:
preset-name: linux-release

- name: cmake configure
uses: ./.github/actions/sil-kit-ci/cmake-configure
id: cmake-configure
with:
linux-docker-image: ${{ inputs.linux-docker-image }}
cmake-source-directory: ${{ steps.dirs.outputs.cmake-source }}
cmake-build-directory: ${{ steps.dirs.outputs.cmake-build }}
cmake-package-directory: ${{ steps.dirs.outputs.cmake-package }}

- name: cmake build
uses: ./.github/actions/sil-kit-ci/cmake-build
id: cmake-build
with:
linux-docker-image: ${{ inputs.linux-docker-image }}
cmake-source-directory: ${{ steps.dirs.outputs.cmake-source }}
cmake-build-directory: ${{ steps.dirs.outputs.cmake-build }}
cmake-package-directory: ${{ steps.dirs.outputs.cmake-package }}

- name: cmake test
uses: ./.github/actions/sil-kit-ci/cmake-test
id: cmake-test
with:
linux-docker-image: ${{ inputs.linux-docker-image }}
cmake-source-directory: ${{ steps.dirs.outputs.cmake-source }}
cmake-build-directory: ${{ steps.dirs.outputs.cmake-build }}
cmake-package-directory: ${{ steps.dirs.outputs.cmake-package }}

- name: cmake package
uses: ./.github/actions/sil-kit-ci/cmake-package
id: cmake-package
with:
linux-docker-image: ${{ inputs.linux-docker-image }}
cmake-source-directory: ${{ steps.dirs.outputs.cmake-source }}
cmake-build-directory: ${{ steps.dirs.outputs.cmake-build }}
cmake-package-directory: ${{ steps.dirs.outputs.cmake-package }}
45 changes: 13 additions & 32 deletions .github/actions/sil-kit-ci/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,51 @@
name: sil-kit-ci/setup-build-environment
name: sil-kit-ci/setup

description: Setup the environment for the other CI actions.

inputs:

preset-name:
description: The preset name from CMakePresets.json
required: true

linux-docker-image:
description: Docker image used under Linux
required: false
default: ghcr.io/mariusbgm/sil-kit-ci-ubuntu-22.04:main

outputs:

linux-docker-image:
description: Docker image used under Linux
value: ${{ inputs.linux-docker-image }}
required: false

cmake-source-directory:
description: The source directory for use by the CMake actions
value: ${{ steps.vars.outputs.cmake-source-directory }}
description: The source directory for use by the cmake actions
required: true

cmake-build-directory:
description: The build directory for use by the CMake actions
value: ${{ steps.vars.outputs.cmake-build-directory }}
description: The build directory for use by the cmake actions
required: true

cmake-package-directory:
description: The build directory for use by the CMake actions
value: ${{ steps.vars.outputs.cmake-package-directory }}
description: The package directory for use by the cmake actions
required: true

runs:
using: composite
steps:

- name: (all) compute variables
id: vars
if: runner.os == 'Linux'
shell: bash
run: |
echo 'cmake-source-directory=${{ github.workspace}}/s/sil-kit' >> "$GITHUB_OUTPUT"
echo 'cmake-build-directory=${{ github.workspace}}/b/${{ inputs.preset-name }}' >> "$GITHUB_OUTPUT"
echo 'cmake-package-directory=${{ github.workspace}}/p/${{ inputs.preset-name }}' >> "$GITHUB_OUTPUT"
- name: (all) checkout sil-kit sources
uses: actions/checkout@v4
with:
path: ${{ steps.vars.outputs.cmake-source-directory }}
path: ${{ inputs.cmake-source-directory }}
submodules: true

- name: (linux) cleanup build and package directories
if: runner.os == 'Linux'
shell: bash
run: |
rm -rf \
"${{ steps.vars.outputs.cmake-build-directory }}" \
"${{ steps.vars.outputs.cmake-package-directory }}"
"${{ inputs.cmake-build-directory }}" \
"${{ inputs.cmake-package-directory }}"
- name: (linux) create build and package directories
if: runner.os == 'Linux'
shell: bash
run: |
mkdir -p \
"${{ steps.vars.outputs.cmake-build-directory }}" \
"${{ steps.vars.outputs.cmake-package-directory }}"
"${{ inputs.cmake-build-directory }}" \
"${{ inputs.cmake-package-directory }}"
- name: (linux) pull docker image for building via cmake
if: runner.os == 'Linux'
Expand Down
49 changes: 4 additions & 45 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ on:
type: boolean

jobs:

ci-testing:
name: Linux Build
environment: public-github-runners
runs-on: ubuntu-22.04
if: inputs.run_build == true

steps:

- name: checkout sil-kit workflows and actions
Expand All @@ -33,55 +35,12 @@ jobs:
sparse-checkout: |
.github
- name: setup build environment
uses: ./.github/actions/sil-kit-ci/setup
- name: run ci build
uses: ./.github/actions/sil-kit-ci/run
id: setup
with:
preset-name: linux-release

- name: cmake configure
uses: ./.github/actions/sil-kit-ci/cmake-configure
id: cmake-configure
with:
preset-name: linux-release
linux-docker-image: ${{ steps.setup.outputs.linux-docker-image }}
cmake-source-directory: ${{ steps.setup.outputs.cmake-source-directory }}
cmake-build-directory: ${{ steps.setup.outputs.cmake-build-directory }}
cmake-package-directory: ${{ steps.setup.outputs.cmake-package-directory }}

- name: cmake build
uses: ./.github/actions/sil-kit-ci/cmake-build
id: cmake-build
with:
preset-name: linux-release
linux-docker-image: ${{ steps.setup.outputs.linux-docker-image }}
cmake-source-directory: ${{ steps.setup.outputs.cmake-source-directory }}
cmake-build-directory: ${{ steps.setup.outputs.cmake-build-directory }}
cmake-package-directory: ${{ steps.setup.outputs.cmake-package-directory }}

- name: cmake test
uses: ./.github/actions/sil-kit-ci/cmake-test
id: cmake-test
with:
preset-name: linux-release
linux-docker-image: ${{ steps.setup.outputs.linux-docker-image }}
cmake-source-directory: ${{ steps.setup.outputs.cmake-source-directory }}
cmake-build-directory: ${{ steps.setup.outputs.cmake-build-directory }}
cmake-package-directory: ${{ steps.setup.outputs.cmake-package-directory }}

- name: cmake package
uses: ./.github/actions/sil-kit-ci/cmake-package
id: cmake-package
with:
preset-name: linux-release
linux-docker-image: ${{ steps.setup.outputs.linux-docker-image }}
cmake-source-directory: ${{ steps.setup.outputs.cmake-source-directory }}
cmake-build-directory: ${{ steps.setup.outputs.cmake-build-directory }}
cmake-package-directory: ${{ steps.setup.outputs.cmake-package-directory }}

# - name: pull docker container
# run: docker pull ghcr.io/mariusbgm/sil-kit-ci-ubuntu-22.04:main

# clang14-release:
# name: Clang 14 release Builds for Ubuntu 22.04
# environment: public-github-runners
Expand Down

0 comments on commit 6576c9e

Please sign in to comment.