Skip to content

Commit

Permalink
ci: re-enable related CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Oct 23, 2023
1 parent ac163dd commit 9c27000
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 41 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,30 @@ concurrency:
cancel-in-progress: true

jobs:
debounce:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
outputs:
abort: ${{ steps.debounce.outputs.abort }}
steps:
- run: printenv
- name: Debounce
if: github.ref_name != 'main' && github.event_name == 'push'
id: debounce
run: |
pr_branches=$(gh pr list --json headRefName --repo $GITHUB_REPOSITORY)
if [[ "$pr_branches" != '[]' && $(echo "$pr_branches" | jq -r --arg GITHUB_REF_NAME '.[].headRefName | select(. == $GITHUB_REF_NAME)') ]]; then
echo "This push is associated with a pull request. Skipping the job."
echo "abort=true" >> "$GITHUB_OUTPUT"
fi
linux:
needs: debounce
if: needs.debounce.outputs.abort != 'true'
uses: ./.github/workflows/linux.yml

macos:
needs: debounce
if: needs.debounce.outputs.abort != 'true'
uses: ./.github/workflows/macos.yml
21 changes: 0 additions & 21 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,7 @@ env:
MOD_PATH: ~/.vmodules/vibe

jobs:
debounce:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
outputs:
abort: ${{ steps.debounce.outputs.abort }}
steps:
- name: Debounce
if: github.ref_name != 'main' && github.event_name == 'push'
id: debounce
run: |
pr_branches=$(gh pr list --json headRefName --repo $GITHUB_REPOSITORY)
if [[ $(echo "$pr_branches" | jq -r --arg GITHUB_REF '.[].headRefName | select(. == $GITHUB_REF)') ]]; then
echo "This push is associated with a pull request. Skipping the job."
echo "abort=true" >> "$GITHUB_OUTPUT"
fi
setup:
needs: debounce
if: needs.debounce.outputs.abort != 'true'
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest]
Expand Down Expand Up @@ -94,8 +75,6 @@ jobs:
- name: Build
run: v -shared ${{ env.MOD_PATH }}
- name: Run tests
# TODO: investigate segfaults when running tests in copmiler + optimization combinations
if: matrix.cc != 'gcc' && matrix.optimization != '-prod'
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,7 @@ env:
MOD_PATH: ~/.vmodules/vibe

jobs:
debounce:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
outputs:
abort: ${{ steps.debounce.outputs.abort }}
steps:
- name: Debounce
if: github.ref_name != 'main' && github.event_name == 'push'
id: debounce
run: |
pr_branches=$(gh pr list --json headRefName --repo $GITHUB_REPOSITORY)
if [[ $(echo "$pr_branches" | jq -r --arg GITHUB_REF '.[].headRefName | select(. == $GITHUB_REF)') ]]; then
echo "This push is associated with a pull request. Skipping the job."
echo "abort=true" >> "$GITHUB_OUTPUT"
fi
setup:
needs: debounce
if: needs.debounce.outputs.abort != 'true'
strategy:
matrix:
os: [macos-11, macos-latest]
Expand Down Expand Up @@ -80,7 +61,6 @@ jobs:
- name: Build
run: v -shared ${{ env.MOD_PATH }}
- name: Run tests
if: matrix.optimization != '-prod'
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
Expand Down

0 comments on commit 9c27000

Please sign in to comment.