diff --git a/.github/workflows/manual-build-linux.yml b/.github/workflows/manual-build-linux.yml new file mode 100644 index 00000000..e6247e02 --- /dev/null +++ b/.github/workflows/manual-build-linux.yml @@ -0,0 +1,89 @@ +name: 'Manual Linux Build' + +on: + + workflow_dispatch: + inputs: + + preset-name: + description: CMake preset + required: true + type: string + default: ci + + docker-image: + description: Docker image + required: true + type: string + default: ghcr.io/mariusbgm/sil-kit-ci-ubuntu-18.04:main + + retention-days: + description: Artifact retention in days (0 disables uploads) + required: true + type: number + default: 0 + + c-compiler: + description: Override the C compiler + required: false + type: string + default: gcc-8 + + cxx-compiler: + description: Override the C++ compiler + required: false + type: string + default: g++-8 + + cmake-configure-args: + description: Extra CMake configure arguments + required: false + type: string + + cmake-build-args: + description: Extra CMake build arguments + required: false + type: string + + ctest-args: + description: Extra CTest arguments + required: false + type: string + default: -R "^I?Test" + + cmake-package-args: + description: Extra CMake package arguments + required: false + type: string + +jobs: + + run: + name: Manual Linux Build (${{ inputs.preset-name }} on ${{ inputs.docker-image }}) + + environment: public-github-runners + runs-on: ubuntu-latest + + steps: + + - name: checkout sil-kit workflows and actions + uses: actions/checkout@v4 + with: + submodules: false + sparse-checkout: .github + + - name: run ci build + uses: ./.github/workflows/call-build.yml + with: + runs-on: ubuntu-22.04 + preset-name: ${{ inputs.preset-name }} + upload-artifacts: ${{ inputs.retention-days > 0 && true || false }} + retention-days: ${{ inputs.retention-days }} + package-name: SilKit-Linux-Manual + linux-docker-image: ${{ inputs.docker-image }} + c-compiler: ${{ inputs.c-compiler }} + cxx-compiler: ${{ inputs.cxx-compiler }} + cmake-configure-args: ${{ steps.extra.outputs.cmake-configure-args }} + cmake-build-args: ${{ steps.extra.outputs.cmake-build-args }} + ctest-args: ${{ steps.extra.outputs.ctest-args }} + cmake-package-args: ${{ steps.extra.outputs.cmake-package-args }} diff --git a/.github/workflows/manual-build-windows.yml b/.github/workflows/manual-build-windows.yml new file mode 100644 index 00000000..66659f6e --- /dev/null +++ b/.github/workflows/manual-build-windows.yml @@ -0,0 +1,88 @@ +name: 'Manual Windows Build' + +on: + + workflow_dispatch: + inputs: + + preset-name: + description: CMake preset + required: true + type: string + default: ci + + runs-on: + description: Runner type + required: true + type: string + default: windows-2019 + + retention-days: + description: Artifact retention in days (0 disables uploads) + required: true + type: number + default: 0 + + msvc-arch: + description: Override the C compiler + required: true + type: string + default: x64 + + msvc-toolset: + description: Override the C++ compiler + required: true + type: string + default: '14.1' + + cmake-configure-args: + description: Extra CMake configure arguments + required: false + type: string + + cmake-build-args: + description: Extra CMake build arguments + required: false + type: string + + ctest-args: + description: Extra CTest arguments + required: false + type: string + default: -R "^I?Test" + + cmake-package-args: + description: Extra CMake package arguments + required: false + type: string + +jobs: + + run: + name: Manual Linux Build (${{ inputs.preset-name }} on ${{ inputs.runs-on }}) + + environment: public-github-runners + runs-on: ubuntu-latest + + steps: + + - name: checkout sil-kit workflows and actions + uses: actions/checkout@v4 + with: + submodules: false + sparse-checkout: .github + + - name: run ci build + uses: ./.github/workflows/call-build.yml + with: + runs-on: ${{ inputs.runs-on }} + preset-name: ${{ inputs.preset-name }} + upload-artifacts: ${{ inputs.retention-days > 0 && true || false }} + retention-days: ${{ inputs.retention-days }} + package-name: SilKit-Windows-Manual + msvc-arch: ${{ inputs.msvc-arch }} + msvc-toolset: ${{ inputs.msvc-toolset }} + cmake-configure-args: ${{ steps.extra.outputs.cmake-configure-args }} + cmake-build-args: ${{ steps.extra.outputs.cmake-build-args }} + ctest-args: ${{ steps.extra.outputs.ctest-args }} + cmake-package-args: ${{ steps.extra.outputs.cmake-package-args }} diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml deleted file mode 100644 index 255f1407..00000000 --- a/.github/workflows/manual-build.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: 'Manual Build' - -on: - - workflow_dispatch: - inputs: - - runs-on: - description: Type of machine to run the job on - required: true - type: choice - options: - - ubuntu-22.04 - - windows-2019 - - preset-name: - description: The CMake preset used for configuration and building - required: false - type: string - default: ci - - upload-artifacts: - description: If true, the created packages are uploaded as artifacts - required: true - type: boolean - default: false - - retention-days: - description: The number of days to keep the uploaded artifacts - required: true - type: number - default: 1 - - package-name: - description: The name of the generated artifact - required: true - type: string - default: sil-kit - - extra: - description: | - Additional arguments to the workflow as a single JSON object. - - The following JSON object is expected (all fields are optional): - - { - "linux": { - "docker": { "image": "..." } - }, - "c": { "compiler": "..." }, - "c++": { "compiler": "..." }, - "msvc": { - "arch": "...", - "toolset": "..." - }, - "cmake": { - "configure": { "args": "..." }, - "build": { "args": "..." }, - "package": { "args": "..." } - }, - "ctest": { - "args": "..." - } - } - required: false - type: string - default: '{}' - -jobs: - - run: - name: Manual Build (${{ inputs.preset-name }} on ${{ inputs.runs-on }}) - - environment: public-github-runners - runs-on: ${{ inputs.runs-on }} - - steps: - - - name: checkout sil-kit workflows and actions - uses: actions/checkout@v4 - with: - submodules: false - sparse-checkout: .github - - - name: parse extra arguments - id: extra - if: runner.os == 'Linux' || runner.os == 'Windows' - shell: bash - env: - MANUAL_RUN_EXTRA_ARGS: '${{ inputs.extra }}' - run: | - extract() { jq --raw-output "$1"' // ""' <<<"$MANUAL_RUN_EXTRA_ARGS" ; } - echo "linux-docker-image=$( extract '.linux.docker.image' )" >> $GITHUB_OUTPUT - echo "c-compiler=$( extract '.c.compiler' )" >> $GITHUB_OUTPUT - echo "cxx-compiler=$( extract '."c++".compiler' )" >> $GITHUB_OUTPUT - echo "msvc-arch=$( extract '.msvc.arch' )" >> $GITHUB_OUTPUT - echo "msvc-toolset=$( extract '.msvc.toolset' )" >> $GITHUB_OUTPUT - echo "cmake-configure-args=$( extract '.cmake.configure.args' )" >> $GITHUB_OUTPUT - echo "cmake-build-args=$( extract '.cmake.build.args' )" >> $GITHUB_OUTPUT - echo "ctest-args=$( extract '.ctest.args' )" >> $GITHUB_OUTPUT - echo "cmake-package-args=$( extract '.cmake.package.args' )" >> $GITHUB_OUTPUT - - - name: run ci build - uses: ./.github/actions/sil-kit-ci/build-sil-kit - with: - preset-name: ${{ inputs.preset-name }} - upload-artifacts: ${{ inputs.upload-artifacts }} - retention-days: ${{ inputs.retention-days }} - package-name: ${{ inputs.package-name }} - linux-docker-image: ${{ steps.extra.outputs.linux-docker-image || 'ghcr.io/mariusbgm/sil-kit-ci-ubuntu-18.04:main' }} - c-compiler: ${{ steps.extra.outputs.c-compiler }} - cxx-compiler: ${{ steps.extra.outputs.cxx-compiler }} - msvc-arch: ${{ steps.extra.outputs.msvc-arch || 'x64' }} - msvc-toolset: ${{ steps.extra.outputs.msvc-toolset || '14.1' }} - cmake-configure-args: ${{ steps.extra.outputs.cmake-configure-args }} - cmake-build-args: ${{ steps.extra.outputs.cmake-build-args }} - ctest-args: ${{ steps.extra.outputs.ctest-args || '-R "^I?Test"' }} - cmake-package-args: ${{ steps.extra.outputs.cmake-package-args }}