Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
karol-kokoszka committed Feb 20, 2024
1 parent 3cf42e4 commit aa67f7b
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 17 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/cancel-running-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Cancel Workflow Runs

on:
pull_request:
types: [ synchronize ]

jobs:
cancel-runs:
runs-on: ubuntu-latest
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Get Workflow Runs
id: get_runs
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: runs } = await github.actions.listRepoWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
branch: ${{ steps.extract_branch.outputs.branch }}
per_page: 100,
status: 'in_progress' // Filter for in-progress runs
});
return runs;
- name: Cancel Workflow Runs
if: ${{ always() }}
run: |
for run in "${{ steps.get_runs.outputs.runtimes }}"; do
# Cancel runs based on conditions
# Example: cancel runs triggered by the main branch
if [[ $run.branch == ${{ steps.extract_branch.outputs.branch }} ]]; then
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${run.id}/cancel
fi
done
32 changes: 16 additions & 16 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ jobs:
- name: Run unit tests
run: make unit-test

# integration-tests:
# strategy:
# fail-fast: false
# matrix:
# # Due to Scylla issue #16349 it is expected that restore-schema
# # jobs with the following config will fail (4 jobs total):
# # - scylla-version: scylla:5.2.X, raft-enabled: true
# # - scylla-version: scylla-enterprise:2024.1.X, raft-enabled: true
# scylla-version: [ 'scylla:5.2.13', 'scylla:5.4.1', 'scylla-enterprise:2023.1.3', 'scylla-enterprise:2024.1.0-rc3' ]
# ip-family: [ IPV4, IPV6 ]
# raft-enabled: [ true, false ]
# uses: ./.github/workflows/integration-tests.yaml
# with:
# scylla-version: ${{ matrix.scylla-version }}
# ip-family: ${{ matrix.ip-family }}
# raft-enabled: ${{ matrix.raft-enabled }}
integration-tests:
strategy:
fail-fast: false
matrix:
# Due to Scylla issue #16349 it is expected that restore-schema
# jobs with the following config will fail (4 jobs total):
# - scylla-version: scylla:5.2.X, raft-enabled: true
# - scylla-version: scylla-enterprise:2024.1.X, raft-enabled: true
scylla-version: [ 'scylla:5.2.13' ] #, 'scylla:5.4.1', 'scylla-enterprise:2023.1.3', 'scylla-enterprise:2024.1.0-rc3' ]
ip-family: [ IPV4 ] #, IPV6 ]
raft-enabled: [false] # [ true, false ]
uses: ./.github/workflows/integration-tests.yaml
with:
scylla-version: ${{ matrix.scylla-version }}
ip-family: ${{ matrix.ip-family }}
raft-enabled: ${{ matrix.raft-enabled }}
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
run-name: Integration tests
name: Integration tests

on:
workflow_call:
Expand Down

0 comments on commit aa67f7b

Please sign in to comment.