Skip to content

Chemistry solver update #1127

Chemistry solver update

Chemistry solver update #1127

name: Pull Request Workflow
on:
# Run tests for any PRs.
pull_request:
branches:
- main
# only allow one test per PR to be run
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
test-matrix:
strategy:
fail-fast: false
matrix:
arch: [ { runson: ubuntu-latest, id: -amd64 } ]
#arch: [ { runson: ARM64, id: -arm64 }, { runson: ubuntu-latest, id: -amd64 } ]
compiler: [ { cc: gcc, cxx: g++, id: -gcc }, { cc: clang, cxx: clang++, id: -clang } ]
indices: [ { index64bit: 0, id: "" }, { index64bit: 1, id: "-index64" } ]
petscConfig: [ arch-ablate-opt ]
tensorFlowConfig: [ "", "enabled_tf" ]
runs-on: ${{ matrix.arch.runson }}
timeout-minutes: 360
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: actions/checkout@v4
- name: Building tests
uses: docker/build-push-action@v5
with:
provenance: false
file: DockerTestFile
tags: framework-test-image-${{matrix.tensorFlowConfig}}-${{ matrix.petscConfig }}${{matrix.compiler.id}}${{matrix.indices.id}}
context: .
build-args: |
PETSC_BUILD_ARCH='${{ matrix.petscConfig }}'
ENABLE_TENSOR_FLOW='${{ matrix.tensorFlowConfig }}'
ABLATE_DEPENDENCY_IMAGE=ghcr.io/ubchrest/ablate/ablate-dependencies${{matrix.compiler.id}}${{matrix.indices.id}}:latest
load: true
- name: Monitor image size
run: |
echo "Monitor image size"
docker history framework-test-image-${{matrix.tensorFlowConfig}}-${{ matrix.petscConfig }}${{matrix.compiler.id}}${{matrix.indices.id}}
- name: Get the version from the build file
run: echo "VERSION=$(docker run --rm framework-test-image-${{matrix.tensorFlowConfig}}-${{ matrix.petscConfig }}${{matrix.compiler.id}}${{matrix.indices.id}} cmake --build --preset=ablate-print-version 2>&1 | head -n 1 )" >> $GITHUB_ENV
- name: Checking the version number for the repo
uses: mukunku/[email protected]
id: checkVersionNumber
with:
tag: 'v${{env.VERSION}}'
- name: Version check error
if: ${{ steps.checkVersionNumber.outputs.exists == 'true' }}
run: |
echo "Version already exists: v$VERSION"
echo "::error file=CMakeLists.txt::The version already exists!"
exit 1
# run all the standard tests
- name: Run tests
run: docker run --rm framework-test-image-${{matrix.tensorFlowConfig}}-${{ matrix.petscConfig }}${{matrix.compiler.id}}${{matrix.indices.id}}
# check to see if any of the regression tests have changed
- name: Get changed files in the regression test folder
id: check-regression-test-files
uses: tj-actions/changed-files@v42
with:
files: tests/regressionTests/**
# if any of the regression tests changed also run all regression tests
- name: Check and run the regression tests
if: steps.check-regression-test-files.outputs.any_changed == 'true'
run: docker run --rm framework-test-image-${{matrix.tensorFlowConfig}}-${{ matrix.petscConfig }}${{matrix.compiler.id}}${{matrix.indices.id}} ctest --preset=pipeline-testing-regressionTests
# copy the configured docs from the test image container
- name: Configure documentation
run: |
id=$(docker create framework-test-image-${{matrix.tensorFlowConfig}}-${{ matrix.petscConfig }}${{matrix.compiler.id}}${{matrix.indices.id}})
docker cp $id:/source/docs/ ./docs-configure
docker rm -v $id
# use a hack to update the url to localhost:8000
- name: Configure Jekyll for Local
run: cp -f docs-configure/_config_pr.yml docs-configure/_config.yaml
# use a hack to update the url to localhost:8000
- name: Build with Jekyll
# right now this can only run on github hosted machines
if: ${{ matrix.arch.runson == 'ubuntu-latest' }}
uses: actions/jekyll-build-pages@v1
with:
source: ./docs-configure
destination: ./_site
# prevent issues by zipping the artifact
- name: Zip the artifact
if: ${{ matrix.arch.runson == 'ubuntu-latest' }}
run: zip -r ablate.dev.${{matrix.tensorFlowConfig}}-${{ matrix.petscConfig }}${{matrix.compiler.id}}${{matrix.indices.id}}.zip ./_site/
- name: 'Upload the ablate.dev Artifact'
# right now this can only run on github hosted machines
if: ${{ matrix.arch.runson == 'ubuntu-latest' }}
uses: actions/upload-artifact@v4
with:
name: ablate.dev.${{matrix.tensorFlowConfig}}-${{ matrix.petscConfig }}${{matrix.compiler.id}}${{matrix.indices.id}}.zip
path: ablate.dev.${{matrix.tensorFlowConfig}}-${{ matrix.petscConfig }}${{matrix.compiler.id}}${{matrix.indices.id}}.zip
retention-days: 5
test:
runs-on: ubuntu-latest
needs: test-matrix
if: ${{ always() }}
steps:
- name: Check on failures
if: needs.test-matrix.result != 'success'
run: |
echo Tests unsuccessful!
exit 1
- run: echo All tests Successful!