-
Notifications
You must be signed in to change notification settings - Fork 8
104 lines (97 loc) · 3.59 KB
/
Copy pathci.yml
File metadata and controls
104 lines (97 loc) · 3.59 KB
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
# Lint, build, and test hippo on a push to main or a pull request
name: hippo-ci
permissions: read-all
on:
pull_request:
workflow_call:
push:
branches: [main]
jobs:
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
mpi: [openmpi, mpich]
env:
IMAGE_FILE_NAME: hippo-release-${{ matrix.mpi }}-${{ github.sha }}.sif
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
pip-install: pre-commit
python-version: 3.14
- name: Install apptainer
run: |
wget https://github.com/apptainer/apptainer/releases/download/v1.4.5/apptainer_1.4.5_amd64.deb
sudo apt install -y ./apptainer_1.4.5_amd64.deb
sudo sed -i 's/sessiondir max size = 64/sessiondir max size = 2000/' /etc/apptainer/apptainer.conf
- name: Quality Checks
run: |
pip install pre-commit
pre-commit install
SKIP=no-commit-to-branch pre-commit run --all
- name: Build apptainer production container
run: apptainer build --build-arg MPI=${{ matrix.mpi }} ${IMAGE_FILE_NAME} apptainer/hippo-release.def
- name: Test production container
run: |
apptainer exec --writable-tmpfs ${IMAGE_FILE_NAME} bash -c "cd /opt/hippo && ./run_tests"
- name: Run unit tests in container
run: |
apptainer exec --writable-tmpfs ${IMAGE_FILE_NAME} bash -c "cd /opt/hippo/unit && ./run_tests"
- name: Docs
shell: bash
if: ${{ matrix.mpi == 'openmpi' }}
run: |
apptainer exec ${IMAGE_FILE_NAME} bash -c "cd /opt/hippo/doc && ./moosedocs.py build --destination=${{ github.workspace }}/doc/htmldoc"
[ -f ${{ github.workspace }}/doc/htmldoc/index.html ]
- name: Upload container artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: apptainer-release-artifact
path: ${{ env.IMAGE_FILE_NAME }}
- name: Artifact docs for pages
id: deployment
if: ${{ matrix.mpi == 'openmpi' }}
uses: actions/upload-pages-artifact@v3
with:
path: ${{ github.workspace }}/doc/htmldoc
- name: Compress docs for release artifact
shell: bash
if: ${{ matrix.mpi == 'openmpi' }}
run: |
tar -czvf hippo-docs-${{ github.sha }}.tar.gz ${{ github.workspace }}/doc/htmldoc
- name: Artifact docs for release
id: docs-artifact
if: ${{ matrix.mpi == 'openmpi' }}
uses: actions/upload-artifact@v7
with:
if-no-files-found: error
name: hippo-docs-artifact
archive: false
path: hippo-docs-${{ github.sha }}.tar.gz
deploy-docs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.repository.fork == false }}
needs: build-test
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the
# run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these
# production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4