-
Notifications
You must be signed in to change notification settings - Fork 34
128 lines (108 loc) · 5.12 KB
/
PullRequestWorkflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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: 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@v35
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@v3
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!