InputSpec: new selection for common use case #1203
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: buildtest | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
push: | |
branches: | |
- 'main' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
gcc13_assertions_build: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0 | |
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
defaults: | |
run: | |
shell: bash | |
outputs: | |
test-chunks: ${{ steps.set-matrix.outputs.chunk-array }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check docker hash | |
uses: ./.github/actions/compute-and-check-dependencies-hash | |
- uses: ./.github/actions/build_4C | |
with: | |
cmake-preset: docker_assertions | |
build-targets: full | |
build-directory: ${{ github.workspace }}/build | |
use-ccache: "true" | |
- uses: ./.github/actions/upload_4C_build | |
with: | |
build-directory: ${{ github.workspace }}/build | |
retention-days: 1 | |
- uses: ./.github/actions/chunk_test_suite | |
id: set-matrix | |
with: | |
build-directory: ${{ github.workspace }}/build | |
source-directory: ${{ github.workspace }} | |
number-of-chunks: 15 | |
junit-report-artifact-name: gcc13_assertions_test_report.xml | |
gcc13_assertions_test: | |
needs: gcc13_assertions_build | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/main' | |
container: | |
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0 | |
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
strategy: | |
fail-fast: false | |
matrix: | |
test-chunk: ${{fromJson(needs.gcc13_assertions_build.outputs.test-chunks)}} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check docker hash | |
uses: ./.github/actions/compute-and-check-dependencies-hash | |
- name: Setup developer environment for testing | |
run: | | |
cd $GITHUB_WORKSPACE | |
git config --global --add safe.directory $GITHUB_WORKSPACE | |
- uses: ./.github/actions/download_4C_build | |
with: | |
build-job: gcc13_assertions_build | |
destination: ${{ github.workspace }}/build | |
- name: Test | |
run: | | |
cd $GITHUB_WORKSPACE/build | |
ctest -I $TEST_CHUNK -j `nproc` --output-on-failure --output-junit $GITHUB_WORKSPACE/gcc13_assertions_test_report-$TEST_CHUNK.xml | |
env: | |
TEST_CHUNK: ${{ matrix.test-chunk }} | |
- name: Upload test report | |
if: success() || failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: gcc13_assertions_test_report-${{ matrix.test-chunk }}.xml | |
path: | | |
${{ github.workspace }}/gcc13_assertions_test_report-${{ matrix.test-chunk }}.xml | |
retention-days: 1 | |
gcc13_assertions_test_report: | |
needs: gcc13_assertions_test | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/main' && (success() || failure()) | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: .github | |
- uses: ./.github/actions/merge_junit_report_artifacts | |
with: | |
junit-report-base-name: gcc13_assertions_test_report | |
retention-days: 1 | |
clang18_build: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0 | |
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
defaults: | |
run: | |
shell: bash | |
outputs: | |
cache-key: ${{ steps.build-4C.outputs.cache-key }} | |
steps: | |
# Due to a bug in runner action the variables $GITHUB_WORKSPACE and ${{ github.workspace }} are different inside a container. https://github.com/actions/runner/issues/2058 | |
# The repo gets cloned to `/__w/4C/4C` ($GITHUB_WORKSPACE) while ${{ github.workspace }} points to `/home/runner/work/4C/4C`.` | |
# Use $GITHUB_WORKSPACE instead of ${{ github.workspace }} | |
- uses: actions/checkout@v4 | |
- name: Check docker hash | |
uses: ./.github/actions/compute-and-check-dependencies-hash | |
- uses: ./.github/actions/build_4C | |
id: build-4C | |
with: | |
cmake-preset: docker_clang | |
build-targets: full | |
build-directory: ${{ github.workspace }}/build | |
use-ccache: "true" | |
- uses: ./.github/actions/upload_4C_build | |
with: | |
build-directory: ${{ github.workspace }}/build | |
retention-days: 1 | |
- name: Upload 4C schema | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.job }}-schema | |
path: | | |
${{ github.workspace }}/build/4C_schema.json | |
retention-days: 1 | |
clang18_test_minimal: | |
needs: clang18_build | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0 | |
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check docker hash | |
uses: ./.github/actions/compute-and-check-dependencies-hash | |
- name: Setup developer environment for testing | |
run: | | |
cd $GITHUB_WORKSPACE | |
git config --global --add safe.directory $GITHUB_WORKSPACE | |
- uses: ./.github/actions/download_4C_build | |
with: | |
build-job: clang18_build | |
destination: ${{ github.workspace }}/build | |
- name: Test | |
run: | | |
cd $GITHUB_WORKSPACE/build | |
ctest -L minimal -j `nproc` --output-on-failure | |
clang18_test_install: | |
needs: clang18_build | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0 | |
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check docker hash | |
uses: ./.github/actions/compute-and-check-dependencies-hash | |
- name: Setup developer environment for testing | |
run: | | |
cd $GITHUB_WORKSPACE | |
git config --global --add safe.directory $GITHUB_WORKSPACE | |
- uses: ./.github/actions/build_4C | |
with: | |
cmake-preset: docker_clang | |
build-targets: install | |
build-directory: ${{ github.workspace }}/build | |
use-ccache: "true" | |
cache-key: ${{needs.clang18_build.outputs.cache-key}} | |
- name: Test the installation | |
run: | | |
cd $GITHUB_WORKSPACE/build/tests/install_test | |
sh test_install.sh | |
clang18_verify_schema: | |
needs: clang18_build | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: clang18_build-schema | |
path: ${{ github.workspace }} | |
- name: json-yaml-validate | |
uses: GrantBirki/json-yaml-validate@v3.2.1 | |
with: | |
base_dir: . | |
json_schema: ${{ github.workspace }}/4C_schema.json | |
yaml_as_json: true | |
ajv_strict_mode: false | |
json_schema_version: draft-2020-12 | |
yaml_extension: .4C.yaml | |
yaml_extension_short: .4C.yml | |
json_extension: .4C.json | |
ensure_all_tests_pass: | |
needs: [gcc13_assertions_test, gcc13_assertions_test_report, gcc13_assertions_build, clang18_build, | |
clang18_test_minimal, clang18_test_install, clang18_verify_schema] | |
runs-on: ubuntu-latest | |
if: always() && github.ref != 'refs/heads/main' | |
steps: | |
- name: Check for successful builds and tests | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} |