Skip to content

Commit

Permalink
bump ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Mar 20, 2024
1 parent 0e8ec33 commit 5956ffb
Showing 1 changed file with 60 additions and 17 deletions.
77 changes: 60 additions & 17 deletions .github/workflows/wipac-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- id: versions
uses: WIPACrepo/[email protected]
uses: WIPACrepo/[email protected]


#############################################################################
# LINTERS
#############################################################################


flake8:
Expand All @@ -42,30 +47,63 @@ jobs:
- uses: WIPACrepo/[email protected]


#############################################################################
# PACKAGING
#############################################################################


writable-branch-detect:
runs-on: ubuntu-latest
outputs:
OKAY: ${{ steps.detect.outputs.OKAY }}
steps:
- name: is this a non-dependabot branch?
id: detect
# dependabot can't access normal secrets
# & don't run non-branch triggers (like tags)
# & we don't want to trigger an update on PR's merge to main/master/default (which is a branch)
run: |
if [[ \
${{github.actor}} != 'dependabot[bot]' && \
${{github.ref_type}} == 'branch' && \
${{format('refs/heads/{0}', github.event.repository.default_branch)}} != ${{github.ref}} \
]]; then
echo "OKAY=true" >> "$GITHUB_OUTPUT"
echo "yes, this branch is compatible"
else
echo "OKAY=false" >> "$GITHUB_OUTPUT"
echo "no, this branch is incompatible"
fi
py-setup:
needs: [ writable-branch-detect ]
runs-on: ubuntu-latest
steps:
# dependabot can't access normal secrets
# & don't run non-branch triggers (like tags)
# & we don't want to trigger an update on PR's merge to main/master/default (which is a branch)
# IOW: only for non-dependabot branches
- if: |
github.actor != 'dependabot[bot]' &&
github.ref_type == 'branch' &&
format('refs/heads/{0}', github.event.repository.default_branch) != github.ref
name: checkout (only for non-dependabot non-default branches)
- if: needs.writable-branch-detect.outputs.OKAY == 'true'
uses: actions/checkout@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- if: |
github.actor != 'dependabot[bot]' &&
github.ref_type == 'branch' &&
format('refs/heads/{0}', github.event.repository.default_branch) != github.ref
name: wipac-dev-py-setup-action (only for non-dependabot non-default branches)
uses: WIPACrepo/[email protected]
- if: needs.writable-branch-detect.outputs.OKAY == 'true'
uses: WIPACrepo/[email protected]
with:
base-keywords: WIPAC IceCube

py-dependencies:
needs: [ writable-branch-detect ]
runs-on: ubuntu-latest
steps:
- if: needs.writable-branch-detect.outputs.OKAY == 'true'
uses: actions/checkout@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- if: needs.writable-branch-detect.outputs.OKAY == 'true'
uses: WIPACrepo/[email protected]


#############################################################################
# TESTS
#############################################################################


unit-tests:
needs: [py-versions]
Expand Down Expand Up @@ -217,10 +255,15 @@ jobs:
docker logs "${{ job.services.mongo.id }}" || true
#############################################################################
# GITHUB RELEASE
#############################################################################


release:
# only run on main/master/default
if: format('refs/heads/{0}', github.event.repository.default_branch) == github.ref
needs: [flake8, mypy, py-setup, unit-tests, integration-tests]
needs: [flake8, mypy, py-setup, py-dependencies, unit-tests, integration-tests]
runs-on: ubuntu-latest
concurrency: release
steps:
Expand Down

0 comments on commit 5956ffb

Please sign in to comment.