Skip to content

Commit

Permalink
Merge pull request #10 from codecov/trent/optional-reqs-caching
Browse files Browse the repository at this point in the history
Optional cache reqs and sentry release
  • Loading branch information
trent-codecov authored Nov 18, 2023
2 parents ad91d4d + 3d90fe4 commit 5b200ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
repo:
type: string
required: true
cache_requirements:
type: boolean
default: true

env:
AR_REPO: ${{ inputs.repo }}
Expand Down Expand Up @@ -36,6 +39,7 @@ jobs:
- name: Cache Requirements
id: cache-requirements
if: inputs.cache_requirements
uses: actions/cache@v3
env:
cache-name: cache-requirements
Expand All @@ -57,18 +61,18 @@ jobs:
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.run_id }}

- name: Load requirements from cache
if: ${{ steps.cache-requirements.outputs.cache-hit == 'true' }}
if: ${{ steps.cache-requirements.outputs.cache-hit == 'true' && inputs.cache_requirements }}
run: |
make load.requirements
- name: Build/pull requirements
if: ${{ steps.cache-requirements.outputs.cache-hit != 'true' }}
if: ${{ steps.cache-requirements.outputs.cache-hit != 'true' && inputs.cache_requirements }}
run: |
make build.requirements
make save.requirements
- name: Push Requirements
if: ${{ steps.cache-requirements.outputs.cache-hit != 'true' && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
if: ${{ steps.cache-requirements.outputs.cache-hit != 'true' && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' && inputs.cache_requirements }}
run: |
make push.requirements
- name: Build app
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/push-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
repo:
type: string
required: true
create_sentry_release:
type: boolean
required: false
default: true

env:
AR_REPO: ${{ inputs.repo }}
Expand Down Expand Up @@ -65,6 +69,7 @@ jobs:
make tag.latest
make push.latest
- name: Create Sentry release
if: inputs.create_sentry_release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.CODECOV_SENTRY_RELEASE_TOKEN }}
Expand Down

0 comments on commit 5b200ce

Please sign in to comment.