From 4e6514ba89c167359b2190dfa8374a8698a21d40 Mon Sep 17 00:00:00 2001 From: Kwabena N Amponsah Date: Tue, 25 Mar 2025 11:36:53 +0000 Subject: [PATCH 1/6] Rename Ubuntu tests --- .github/workflows/{ubuntu-2004.yml => ubuntu-tests.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ubuntu-2004.yml => ubuntu-tests.yml} (100%) diff --git a/.github/workflows/ubuntu-2004.yml b/.github/workflows/ubuntu-tests.yml similarity index 100% rename from .github/workflows/ubuntu-2004.yml rename to .github/workflows/ubuntu-tests.yml From c61dd36409e6300726aba9ff3faa607400967fce Mon Sep 17 00:00:00 2001 From: Kwabena N Amponsah Date: Tue, 25 Mar 2025 15:20:53 +0000 Subject: [PATCH 2/6] Update ubuntu-tests workflow --- .github/workflows/ubuntu-tests.yml | 155 ++++++++++++++--------------- 1 file changed, 76 insertions(+), 79 deletions(-) diff --git a/.github/workflows/ubuntu-tests.yml b/.github/workflows/ubuntu-tests.yml index ad871e1..568bbf9 100644 --- a/.github/workflows/ubuntu-tests.yml +++ b/.github/workflows/ubuntu-tests.yml @@ -1,92 +1,89 @@ -name: Ubuntu 20.04 ApPredict test suite +name: Ubuntu ApPredict test suite on: + schedule: + - cron: "0 0 * * *" # every day at midnight. + + pull_request: + push: branches: - main - - schedule: - - cron: '0 0 * * *' - - workflow_dispatch: + + workflow_dispatch: inputs: - chaste_clone_params: - description: "Chaste clone parameters" - default: "--branch develop" + chaste_branch: + description: "Chaste branch" + required: false type: "string" - -jobs: + default: "develop" +jobs: build-and-test: + runs-on: ubuntu-22.04 - name: Build and test on Ubuntu 20.04 - runs-on: [self-hosted, ubuntu-focal] env: CHASTE_TEST_OUTPUT: ${{ github.workspace }}/chaste-test-dir - CC: gcc - CXX: g++ - + chaste_branch: ${{ inputs.chaste_branch || 'develop' }} + steps: - - name: set number of processors - run: | - echo "NPROC=$(( $(nproc) < 12 ? $(nproc) : 12 ))" >> $GITHUB_ENV - - - name: checkout Chaste repository - run: | - rm Chaste -rf - git clone https://github.com/Chaste/Chaste.git ${{ inputs.chaste_clone_params }} - - - name: checkout ApPredict project - uses: actions/checkout@v3 - with: - repository: Chaste/ApPredict - path: Chaste/projects/ApPredict - submodules: recursive - - - name: ${CXX} version - run: | - ${CXX} --version - ${CXX} --version > compiler.version - - - name: make build and test directories - run: | - mkdir -p Chaste/build - mkdir -p ${CHASTE_TEST_OUTPUT} - - - name: cmake configure - run: nice -n 10 cmake -DCMAKE_BUILD_TYPE=Release .. - working-directory: Chaste/build - - - name: remove cellml - run: rm -rf ApPredict/src/cellml - working-directory: Chaste/projects - - - name: cmake configure again - run: nice -n 10 cmake -DCMAKE_BUILD_TYPE=Release .. - working-directory: Chaste/build - - - name: build core libraries - run: nice -n 10 cmake --build . --parallel ${NPROC} --target chaste_core - working-directory: Chaste/build - - - name: build heart - run: nice -n 10 cmake --build . --parallel ${NPROC} --target chaste_heart - working-directory: Chaste/build - - - name: build ApPredict - run: nice -n 10 cmake --build . --parallel ${NPROC} --target project_ApPredict - working-directory: Chaste/build - - - name: run ApPredict test pack - run: nice -n 10 ctest -j${NPROC} -L ApPredict --output-on-failure - working-directory: Chaste/build - - - name: send notifications - if: failure() - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1 - with: - channel: ap-predict - status: FAILED - color: danger + - name: Checkout Chaste/${{ env.chaste_branch }} + uses: actions/checkout@v4 + with: + repository: Chaste/Chaste + path: Chaste + ref: ${{ env.chaste_branch }} + + - name: Checkout ApPredict + uses: actions/checkout@v4 + with: + repository: Chaste/ApPredict + path: Chaste/projects/ApPredict + + - name: Setup directories + run: | + mkdir -p build + mkdir -p ${CHASTE_TEST_OUTPUT} + + - name: Install dependencies + run: | + sudo wget -O /usr/share/keyrings/chaste.asc https://chaste.github.io/chaste.asc + repo="deb [signed-by=/usr/share/keyrings/chaste.asc] https://chaste.github.io/ubuntu jammy/" + echo "${repo}" | sudo tee /etc/apt/sources.list.d/chaste.list + sudo apt-get update + sudo apt-get install -y chaste-dependencies + + - name: Configure + run: cmake -DCMAKE_BUILD_TYPE=Release .. + working-directory: build + + - name: Remove cellml + run: rm -rf Chaste/projects/ApPredict/src/cellml/ + + - name: Configure again # Checks that missing cellml is fetched (#30, #26) + run: cmake -DCMAKE_BUILD_TYPE=Release .. + working-directory: build + + - name: TestChasteBuildInfo + run: | + cmake --build . --target TestChasteBuildInfo --parallel $(nproc) + ctest -V -R TestChasteBuildInfo$ + working-directory: build + + - name: Build ApPredict + run: cmake --build . --target project_ApPredict --parallel $(nproc) + working-directory: build + + - name: Run ApPredict test suite + run: ctest -L ApPredict -j $(nproc) --output-on-failure + working-directory: build + + - name: send notifications + if: failure() + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} + uses: voxmedia/github-action-slack-notify-build@v1 + with: + channel: ap-predict + status: FAILED + color: danger From f4998284223aa105083b64373131d17806fcda82 Mon Sep 17 00:00:00 2001 From: Kwabena N Amponsah Date: Tue, 25 Mar 2025 15:21:45 +0000 Subject: [PATCH 3/6] Remove deprecated slack notification action --- .github/workflows/ubuntu-tests.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/ubuntu-tests.yml b/.github/workflows/ubuntu-tests.yml index 568bbf9..2be3011 100644 --- a/.github/workflows/ubuntu-tests.yml +++ b/.github/workflows/ubuntu-tests.yml @@ -77,13 +77,3 @@ jobs: - name: Run ApPredict test suite run: ctest -L ApPredict -j $(nproc) --output-on-failure working-directory: build - - - name: send notifications - if: failure() - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1 - with: - channel: ap-predict - status: FAILED - color: danger From 56b6ada1fd5f91d4e461ab18b1d760c5db2df966 Mon Sep 17 00:00:00 2001 From: Kwabena N Amponsah Date: Tue, 25 Mar 2025 15:29:50 +0000 Subject: [PATCH 4/6] Fix github workflow paths --- .github/workflows/ubuntu-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-tests.yml b/.github/workflows/ubuntu-tests.yml index 2be3011..8fa2025 100644 --- a/.github/workflows/ubuntu-tests.yml +++ b/.github/workflows/ubuntu-tests.yml @@ -54,14 +54,14 @@ jobs: sudo apt-get install -y chaste-dependencies - name: Configure - run: cmake -DCMAKE_BUILD_TYPE=Release .. + run: cmake -DCMAKE_BUILD_TYPE=Release ../Chaste working-directory: build - name: Remove cellml run: rm -rf Chaste/projects/ApPredict/src/cellml/ - name: Configure again # Checks that missing cellml is fetched (#30, #26) - run: cmake -DCMAKE_BUILD_TYPE=Release .. + run: cmake -DCMAKE_BUILD_TYPE=Release ../Chaste working-directory: build - name: TestChasteBuildInfo From fcf16494e216ecc5abd73e730d77459c30546150 Mon Sep 17 00:00:00 2001 From: Kwabena N Amponsah Date: Tue, 25 Mar 2025 17:25:35 +0000 Subject: [PATCH 5/6] Test slack notification --- .github/workflows/ubuntu-tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ubuntu-tests.yml b/.github/workflows/ubuntu-tests.yml index 8fa2025..0525f1b 100644 --- a/.github/workflows/ubuntu-tests.yml +++ b/.github/workflows/ubuntu-tests.yml @@ -27,6 +27,20 @@ jobs: chaste_branch: ${{ inputs.chaste_branch || 'develop' }} steps: + - name: Slack notification + uses: slackapi/slack-github-action@v2.0.0 + with: + method: chat.postMessage + token: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} + payload: | + channel: ${{ secrets.SLACK_CHANNEL_ID }} + text: "Chaste/ApPredict\nStatus: ${{ job.status }}\nCommit: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + blocks: + - type: "section" + text: + type: "mrkdwn" + text: ":rotating_light: \n*Status:* <${{ job.status }}>\n*Commit:* <${{ github.event.pull_request.html_url || github.event.head_commit.url }}>" + - name: Checkout Chaste/${{ env.chaste_branch }} uses: actions/checkout@v4 with: From b80121e50f740331145d3d0d5c286f2ed2602f03 Mon Sep 17 00:00:00 2001 From: Kwabena N Amponsah Date: Tue, 25 Mar 2025 17:30:12 +0000 Subject: [PATCH 6/6] Only send slack notification on failure --- .github/workflows/ubuntu-tests.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ubuntu-tests.yml b/.github/workflows/ubuntu-tests.yml index 0525f1b..042f722 100644 --- a/.github/workflows/ubuntu-tests.yml +++ b/.github/workflows/ubuntu-tests.yml @@ -27,20 +27,6 @@ jobs: chaste_branch: ${{ inputs.chaste_branch || 'develop' }} steps: - - name: Slack notification - uses: slackapi/slack-github-action@v2.0.0 - with: - method: chat.postMessage - token: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} - payload: | - channel: ${{ secrets.SLACK_CHANNEL_ID }} - text: "Chaste/ApPredict\nStatus: ${{ job.status }}\nCommit: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" - blocks: - - type: "section" - text: - type: "mrkdwn" - text: ":rotating_light: \n*Status:* <${{ job.status }}>\n*Commit:* <${{ github.event.pull_request.html_url || github.event.head_commit.url }}>" - - name: Checkout Chaste/${{ env.chaste_branch }} uses: actions/checkout@v4 with: @@ -91,3 +77,18 @@ jobs: - name: Run ApPredict test suite run: ctest -L ApPredict -j $(nproc) --output-on-failure working-directory: build + + - name: Slack notification + if: failure() + uses: slackapi/slack-github-action@v2.0.0 + with: + method: chat.postMessage + token: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} + payload: | + channel: ${{ secrets.SLACK_CHANNEL_ID }} + text: "Chaste/ApPredict\nStatus: ${{ job.status }}\nBranch: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + blocks: + - type: "section" + text: + type: "mrkdwn" + text: ":rotating_light: \n*Status:* <${{ job.status }}>\n*Branch:* <${{ github.event.pull_request.html_url || github.event.head_commit.url }}>"