Skip to content

Commit

Permalink
GHI #20 Add second job
Browse files Browse the repository at this point in the history
  • Loading branch information
doodspav committed Dec 19, 2023
1 parent fec0f57 commit 72551ca
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests with Warnings
name: Run Tests on Native Platforms

on:
workflow_call:
Expand Down Expand Up @@ -28,11 +28,6 @@ on:
required: true
type: string
default: ''
patomic_path:
description: 'Source directory of patomic repository'
required: true
type: string
default: ''

jobs:
warning:
Expand All @@ -54,8 +49,8 @@ jobs:
}
# apply function to all inputs
check_input "os" "${{ inputs.os }}"
check_input "preset" "${{ inputs.preset }}"
check_input "architecture" "${{ inputs.architecture }}"
check_input "triple" "${{ inputs.triple }}"
check_input "cmake_build_shared" "${{ inputs.cmake_build_shared }}"
check_input "patomic_path" "${{ inputs.patomic_path }}"
50 changes: 50 additions & 0 deletions .github/workflows/reusable-test-qemu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Run Tests on Emulated Platforms

on:
workflow_call:
inputs:
preset:
description: 'CMake preset used to build patomic and googletest'
required: true
type: string
default: ''
architecture:
description: 'CPU architecture tests are run on, passed to QEMU'
required: true
type: string
default: ''
triple:
description: 'Platform triple to compile for, used to install correct compiler and sysroot'
required: true
type: string
default: ''
cmake_build_shared:
description: 'Determines value of BUILD_SHARED_LIBS for CMake, must be considered a boolean by CMake'
required: true
type: string
default: ''

jobs:
warning:
runs-on: ubuntu-latest
steps:
- name: Check No Empty Inputs
shell: bash
run: |
# checks input is not empty
check_input() {
input_name="${1}"
input_value="${2}"
if [[ -z "${input_value}" ]]; then
echo "Error: required input '${input_name}' is empty or was not specified."
exit 1
else
echo "${input_name}: ${input_value}"
fi
}
# apply function to all inputs
check_input "preset" "${{ inputs.preset }}"
check_input "architecture" "${{ inputs.architecture }}"
check_input "triple" "${{ inputs.triple }}"
check_input "cmake_build_shared" "${{ inputs.cmake_build_shared }}"
16 changes: 14 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@ jobs:
os:
- macos
- ubuntu
uses: doodspav/patomic/.github/workflows/reusable-test-warning.yml@feature/ghi-20-inner-stuff
uses: doodspav/patomic/.github/workflows/reusable-test-native.yml@feature/ghi-20-inner-stuff
with:
os: ${{ matrix.os }}
preset: some-preset
architecture: some-architecture
triple: some-triple
cmake_build_shared: ON
patomic_path: some-path

test-qemu:
strategy:
matrix:
os:
- macos
- ubuntu
uses: doodspav/patomic/.github/workflows/reusable-test-qemu.yml@feature/ghi-20-inner-stuff
with:
preset: some-preset
architecture: some-architecture
triple: some-triple
cmake_build_shared: ON

0 comments on commit 72551ca

Please sign in to comment.