update dockerfile path #719
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: ATS CI | |
on: | |
workflow_dispatch: | |
branches: | |
- '**' | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- ats-* | |
jobs: | |
buildx_test: | |
runs-on: ubuntu-latest | |
name: Build and test with Docker | |
steps: | |
- name: Check out the Amanzi repo | |
uses: actions/checkout@v3 | |
with: | |
repository: amanzi/amanzi | |
ref: master | |
submodules: recursive | |
- name: Extract the ATS branch name | |
id: branch | |
working-directory: Docker | |
run: | | |
echo "ATS_BRANCH=$GITHUB_REF_NAME" >> $GITHUB_ENV | |
- name: Does Amanzi branch of the same name exist? | |
id: amanzi_branch | |
run: | | |
echo "AMANZI_BRANCH=$(git ls-remote --heads origin ${GITHUB_REF_NAME} | sed 's/.*refs\/heads\///')" >> $GITHUB_ENV | |
- name: Does ats-regression-tests branch of the same name exist? | |
id: ats_tests_branch | |
working-directory: src/physics/ats/testing/ats-regression-tests | |
run: | | |
echo "ATS_TESTS_BRANCH=$(git ls-remote --heads origin ${GITHUB_REF_NAME} | sed 's/.*refs\/heads\///')" >> $GITHUB_ENV | |
- name: Filter the branch name to generate a tag for Docker | |
id: tag | |
run: | | |
echo "ATS_BRANCH_TAG=$(echo ${{env.ATS_BRANCH}} | sed -e 's/\//--/g')" >> $GITHUB_ENV | |
- name: Get TPLs version | |
id: version | |
working-directory: Docker | |
run: | | |
echo "AMANZI_TPLS_VER=$(./get_tpls_version.sh)" >> $GITHUB_ENV | |
- name: Print out environment | |
run: | | |
echo "Amanzi branch = ${{env.AMANZI_BRANCH}}"; | |
echo "ATS branch = ${{env.ATS_BRANCH}}"; | |
echo "ats-regression-tests branch = ${{env.ATS_TESTS_BRANCH}}"; | |
echo "Tag reference = ${{env.ATS_BRANCH_TAG}}" | |
echo "TPLs version = ${{env.AMANZI_TPLS_VER}}" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
password: ${{secrets.DOCKERHUB_PASSWORD}} | |
- name: Build and push multiarch image | |
uses: docker/build-push-action@v3 | |
with: | |
tags: metsi/ats:${{env.ATS_BRANCH_TAG}}-latest | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
build-args: | | |
amanzi_branch=${{env.AMANZI_BRANCH}} | |
ats_branch=${{env.ATS_BRANCH}} | |
amanzi_tpls_ver=${{env.AMANZI_TPLS_VER}} | |
file: Docker/Dockerfile-ATS-build | |
- name: Run tests | |
id: tests | |
working-directory: Docker | |
run: | |
docker run --rm ${{secrets.DOCKERHUB_USERNAME}}/ats:${{env.ATS_BRANCH_TAG}}-latest /bin/bash -c "cd ~/amanzi_builddir/ats; ctest" | |