Skip to content

Commit

Permalink
[INFRA] Rework API stability cron
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Jul 28, 2024
1 parent ac0b27d commit 48c6a3d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/cron_comment_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Failure {{ build }} on gcc{{ compiler }}
Failure {{ build }} on {{ compiler }}
---

See {{ url }} for more information.
92 changes: 42 additions & 50 deletions .github/workflows/cron_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,76 +18,58 @@ concurrency:
env:
SEQAN3_NO_VERSION_CHECK: 1
TZ: Europe/Berlin
ISSUE: 2746 # Issue number to use for reporting failures
ISSUE: 3280 # Issue number to use for reporting failures

defaults:
run:
shell: bash -Eexuo pipefail {0}
shell: bash -Eeuxo pipefail {0}

jobs:
build:
name: API-Stability gcc${{ matrix.compiler }}
runs-on: ubuntu-22.04
timeout-minutes: 300
name: API-Stability ${{ matrix.compiler }}
runs-on: ubuntu-latest
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
compiler: [11, 12, 13]

compiler: ["gcc-14", "gcc-13", "gcc-12", "gcc-11"]
container:
image: ghcr.io/seqan/${{ matrix.compiler }}
volumes:
- /home/runner:/home/runner
steps:
- name: Checkout SeqAn3
- name: Checkout
uses: actions/checkout@v4
with:
path: seqan3
fetch-depth: 1
submodules: true

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: seqan3/submodules/seqan
fetch-depth: 1

- name: Setup compiler
uses: seqan/actions/setup-compiler@main
with:
compiler: gcc-${{ matrix.compiler }}

- name: Install CMake
uses: seqan/actions/setup-cmake@main
with:
cmake: 3.16.9
path: submodules/seqan

- name: Configure tests
run: |
mkdir seqan3-build
cd seqan3-build
cmake ../seqan3/test/api_stability -DCMAKE_BUILD_TYPE=Release
mkdir build && cd build
cmake ../test/api_stability -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}"
- name: Build tests
run: |
cd seqan3-build
CMAKE_BUILD_PARALLEL_LEVEL=2 cmake --build . -- -k 2>&1 | tee build.log
- name: Setup Python
if: ${{ failure() }}
uses: actions/setup-python@v5
with:
python-version: '3.x'
working-directory: build
run: make -k 2>&1 | tee build.log

- name: Process Log
if: ${{ failure() }}
if: failure()
run: |
FILE="seqan3/.github/ISSUE_TEMPLATE/cron_comment_template.md"
python3 seqan3/.github/workflows/scripts/process_compiler_error_log.py seqan3-build/build.log >> $FILE
FILE=".github/ISSUE_TEMPLATE/cron_comment_template.md"
python3 .github/workflows/scripts/process_compiler_error_log.py build/build.log >> ${FILE}
- name: Create comment body
if: ${{ failure() }}
if: failure()
id: comment-body
run: |
FILE="seqan3/.github/ISSUE_TEMPLATE/cron_comment_template.md"
FILE=".github/ISSUE_TEMPLATE/cron_comment_template.md"
URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
sed -i "s@{{ build }}@${{ matrix.build }}@" $FILE
sed -i "s@{{ compiler }}@${{ matrix.compiler }}@" $FILE
Expand All @@ -96,21 +78,31 @@ jobs:
cat $FILE >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create comment body
if: success()
id: comment-body
run: echo "body=Success ${{ matrix.build }} on ${{ matrix.compiler }}" >> $GITHUB_OUTPUT

- name: Reopen issue
if: ${{ failure() }}
uses: octokit/[email protected]
with:
route: PATCH /repos/{owner}/{repo}/issues/{issue_number}
owner: ${{ github.repository_owner }}
repo: seqan3
issue_number: ${{ env.ISSUE }}
state: "open"
if: failure()
run: gh issue reopen ${{ env.ISSUE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.SEQAN_ACTIONS_PAT }}
GH_REPO: ${{ github.repository }}

- name: Create comment
if: ${{ failure() }}
- name: Find Comment
uses: peter-evans/find-comment@v3
id: find_comment
with:
issue-number: ${{ env.ISSUE }}
body-includes: ${{ matrix.build }} on ${{ matrix.compiler }}

- name: Update comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ env.ISSUE }}
body: ${{ steps.comment-body.outputs.body }}
edit-mode: replace
token: ${{ secrets.SEQAN_ACTIONS_PAT }}

4 changes: 2 additions & 2 deletions .github/workflows/scripts/process_compiler_error_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import re
import sys

# https://regex101.com/r/aE0qX3/1
tokenise_regex = re.compile(r"(\[\s*\d+%\](?:.(?!\[\s*\d+%\]))+(?:error:).*?(?=\[\s*\d+%\]|$))", re.DOTALL)
# https://regex101.com/r/aE0qX3/2
tokenise_regex = re.compile(r"(\[\s*\d+%\](?:.(?!\[\s*\d+%\]))+(?:: error:).*?(?=\[\s*\d+%\]|$))", re.DOTALL)
# Match line containg 'error:', but stop at linebreak, semicolon or parenthesis.
error_regex = re.compile(r"(error:[^(;\n]*)")

Expand Down

0 comments on commit 48c6a3d

Please sign in to comment.