Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor GHA to use composite action instead of workflow #17

Merged

Conversation

dfsnow
Copy link
Member

@dfsnow dfsnow commented Aug 8, 2023

This PR simplifies PTAXSIM's GitHub Actions workflows. It replaces the composable workflow to download and extract PTAXSIM with a single composite action. It also replaces long-lived AWS credentials with an OIDC assumed role.

Closes #15 and #16.

@dfsnow dfsnow linked an issue Aug 8, 2023 that may be closed by this pull request
@dfsnow dfsnow force-pushed the 15-refactor-gha-composable-workflow-to-use-action-instead branch from 86f41a0 to fbe1a0a Compare August 8, 2023 15:34
@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #17 (ba4fc73) into master (0a4c678) will not change coverage.
The diff coverage is n/a.

❗ Current head ba4fc73 differs from pull request most recent head 36b1ab6. Consider uploading reports for the commit 36b1ab6 to get more accurate results

@@            Coverage Diff            @@
##            master       #17   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          439       439           
=========================================
  Hits           439       439           

@dfsnow dfsnow force-pushed the 15-refactor-gha-composable-workflow-to-use-action-instead branch from ab3a7ea to c799892 Compare August 8, 2023 16:31
@@ -15,6 +15,8 @@
\.lintr$
\.travis\.yml$
^.*\.Rproj$
^.*\.db$
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to prevent the PTAXSIM database file from being copied into the build directory during install.

- name: Prepare PTAXSIM database
uses: ./.github/actions/prepare-ptaxsim
with:
ASSUMED_ROLE: ${{ secrets.AWS_IAM_ROLE_TO_ASSUME_ARN }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hacky way to pass a secret to a composite action. Needed until this issue actions/toolkit#1168 is resolved. It still properly masks the secret in the output logs.

@dfsnow
Copy link
Member Author

dfsnow commented Aug 8, 2023

@jeancochrane or @wrridgeway, can one of you give this a quick gander before I yolo this into master?

wrridgeway
wrridgeway previously approved these changes Aug 8, 2023
Copy link
Member

@wrridgeway wrridgeway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat stuff.

jeancochrane
jeancochrane previously approved these changes Aug 8, 2023
Copy link
Contributor

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactor!

Comment on lines 70 to 77
- name: Save database cache
uses: actions/cache/save@v3
id: save_db
if: steps.restore_db_cache.outputs.cache-hit != 'true'
with:
path: ptaxsim.db.bz2
key: ${{ format('{0}-{1}', env.PTAXSIM_VERSION, hashFiles('DESCRIPTION')) }}
enableCrossOsArchive: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Question, non-blocking] I'm not quite an expert on GA caching, what's the benefit for this action of splitting save and restore into two steps instead of using the combined actions/cache action that handles both?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No benefit at all, it's just an artifact of the complexity from pre-refactor. Fixed by 938f629!

@dfsnow dfsnow dismissed stale reviews from jeancochrane and wrridgeway via 938f629 August 8, 2023 18:21
@dfsnow dfsnow merged commit 3d0349a into master Aug 8, 2023
10 checks passed
@dfsnow dfsnow deleted the 15-refactor-gha-composable-workflow-to-use-action-instead branch August 8, 2023 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor GHA composable workflow to use Action instead
3 participants