Skip to content

Commit

Permalink
CI: Simplify Stubs
Browse files Browse the repository at this point in the history
- always run
- always test result
- only push if in mainline `development` branch
  • Loading branch information
ax3l committed Feb 1, 2024
1 parent e8a6c04 commit 9d575d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ concurrency:
jobs:
stubs:
# Pushes should only run on mainline branch "development"
# TODO: We can also skip this, if the latest commit's name is "Update Stub Files"
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/pyamrex' && github.ref == 'refs/heads/development'
name: 🔄 Update Stub Files
secrets:
PYAMREX_PUSH_TOKEN: ${{ secrets.PYAMREX_PUSH_TOKEN }}
uses: ./.github/workflows/stubs.yml

ubuntu:
if: always() && !contains(needs.*.result, 'failure') && github.event.pull_request.draft == false
name: 🐧 Ubuntu
needs: [stubs]
uses: ./.github/workflows/ubuntu.yml
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ jobs:

steps:
- uses: actions/checkout@v4
if: github.event_name != 'push' || github.repository != 'AMReX-Codes/pyamrex' || github.ref != 'refs/heads/development'

- uses: actions/checkout@v4
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/pyamrex' && github.ref == 'refs/heads/development'
with:
token: ${{ secrets.PYAMREX_PUSH_TOKEN }}

- name: Pull Remote Changes
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/pyamrex' && github.ref == 'refs/heads/development'
run: git pull

- uses: actions/setup-python@v4
Expand Down Expand Up @@ -84,5 +89,6 @@ jobs:
- uses: stefanzweifel/git-auto-commit-action@v5
name: Commit Updated Stub Files
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/pyamrex' && github.ref == 'refs/heads/development'
with:
commit_message: Update Stub Files

0 comments on commit 9d575d5

Please sign in to comment.