Skip to content

Support PETSc 3.21 - 3.22 #713

Support PETSc 3.21 - 3.22

Support PETSc 3.21 - 3.22 #713

name: Memory testing
on:
workflow_dispatch:
pull_request:
branches:
- '**'
push:
branches:
- develop
jobs:
build-and-test:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:off') }}
runs-on: ubuntu-22.04
env:
CHASTE_DIR: ${{ github.workspace }}/Chaste
MEMTEST_DIR: ${{ github.workspace }}/memory-testing
CHASTE_TEST_OUTPUT: ${{ github.workspace }}/chaste-test-dir
CHASTE_BUILD_DIR: ${{ github.workspace }}/Chaste/chaste-build-dir
steps:
- name: get current datetime
id: get-datetime
run: echo "datetime=$(date +%Y-%m-%d_%H-%M-%S)" >> $GITHUB_OUTPUT
- name: set environment for pull request
run: |
echo "Chaste_GH_WORKFLOW_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "Chaste_GH_WORKFLOW_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
if: github.event_name == 'pull_request'
- name: set environment for push or workflow dispatch
run: |
echo "Chaste_GH_WORKFLOW_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
echo "Chaste_GH_WORKFLOW_SHA=${{ github.sha }}" >> $GITHUB_ENV
if: (github.event_name == 'push') || (github.event_name == 'workflow_dispatch')
- name: checkout Chaste
uses: actions/checkout@v4
with:
repository: Chaste/Chaste
path: Chaste
- name: install dependencies
run: |
echo 'deb [signed-by=/usr/share/keyrings/chaste.asc] https://chaste.github.io/ubuntu jammy/' | sudo tee -a /etc/apt/sources.list.d/chaste.list
sudo wget -O /usr/share/keyrings/chaste.asc https://chaste.github.io/chaste.asc
sudo apt update
sudo apt install chaste-dependencies
- name: Downgrade libexpat1 (native ubuntu-22.04 only)
# if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
if dpkg -l | grep libexpat1-dev | grep 2.4.7-1ubuntu; then
sudo apt-get install -y --allow-downgrades libexpat1=2.4.7-1 libexpat1-dev=2.4.7-1
fi
- name: make build and test directories
run: |
mkdir -p ${CHASTE_BUILD_DIR}
mkdir -p ${CHASTE_TEST_OUTPUT}
- name: cmake configure
run: cmake -DCMAKE_BUILD_TYPE=Debug -DChaste_MEMORY_TESTING_CPUS=4 ..
working-directory: ${{ env.CHASTE_BUILD_DIR }}
- name: build continuous test pack
run: cmake --build . --target Continuous --parallel 4
working-directory: ${{ env.CHASTE_BUILD_DIR }}
- name: run memtest
run: cmake --build . --target memtest --parallel 4
working-directory: ${{ env.CHASTE_BUILD_DIR }}
- name: check if index file successfully created
id: index-exists
run: |
if [ -e ${CHASTE_BUILD_DIR}/memtest/index.html ]; then
echo "Index file exists"
echo "index=True" >> $GITHUB_OUTPUT
else
echo "Index file does not exist"
echo "index=False" >> $GITHUB_OUTPUT
fi
if: always()
- name: checkout memory-testing
uses: actions/checkout@v4
with:
repository: Chaste/memory-testing
path: memory-testing
fetch-depth: 0
token: ${{ secrets.MEMORY_TESTING_ACCESS }}
if: always() && steps.index-exists.outputs.index == 'True'
- name: copy results
run: |
mkdir ${MEMTEST_DIR}/log-files/${{ steps.get-datetime.outputs.datetime }}
cp ${CHASTE_BUILD_DIR}/memtest/* ${MEMTEST_DIR}/log-files/${{ steps.get-datetime.outputs.datetime }}/
if: always() && steps.index-exists.outputs.index == 'True'
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: generate index file
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install dominate
python write_index.py
working-directory: ${{ env.MEMTEST_DIR }}
if: always() && steps.index-exists.outputs.index == 'True'
- name: commit and push results
run: |
git config user.name "github-action"
git config user.email "github-action"
git add --all
git commit -m "upload memtest results" || echo "No changes to commit"
git push
working-directory: ${{ env.MEMTEST_DIR }}
if: always() && steps.index-exists.outputs.index == 'True'
- name: results URL on chaste.github.io
run: |
echo https://chaste.github.io/memory-testing/${{ steps.get-datetime.outputs.datetime }}/index.html
if: always() && steps.index-exists.outputs.index == 'True'