Skip to content

Add common GitHub Actions recipes - #206

Open
willbarton wants to merge 6 commits into
mainfrom
github-actions
Open

Add common GitHub Actions recipes#206
willbarton wants to merge 6 commits into
mainfrom
github-actions

Conversation

@willbarton

Copy link
Copy Markdown
Member

This is an attempt to codify some common GitHub Actions recipes that we can use, probably with tweaks, across multiple repositories.

It is based in part on work that the Dev Services team did to add GitHub Actions to teachers-digital-platform and previously to cfgov-refresh

@willbarton
willbarton requested review from a teamJune 19, 2020 13:41
This is an attempt to codify some common GitHub Actions recipes that we can use, probably with tweaks, across multiple repositories.
It is based in part on work that the Dev Services team did to add GitHub Actions to [teachers-digital-platform](cfpb/curriculum-review-tool#383) and previously to cfgov-refresh

@higs4281higs4281 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One typo noted.

Comment threadguides/github-actions.md Outdated
Co-authored-by: william higgins <higs4281@users.noreply.github.com>
Comment threadguides/github-actions.md Outdated

## Running front-end unit tests

```yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of having the actions duplicated here, maybe link to the actual file so we don't have to keep this in sync?

Same for the other snippets in this file.

@anselmbradfordanselmbradfordJun 22, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh nevermind, I see you say these will likely be tweaked and are for use across projects, not just cfgov-refresh.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yeah... the intention is to provide a starting point for creating actions... I was looking at the ones we have so far, and there are little differences, not huge, but enough that I think they'll need to be tweaked for each repo.

@ScotchesterScotchester left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks great, overall. There are a couple more typos, and one suggestion to add: It would be nice to offer suggested filenames, as those affect the name of the checks when reported on PRs.

Comment threadREADME.md Outdated
Comment threadguides/github-actions.md Outdated
willbartonand others added 2 commits June 23, 2020 08:39
Co-authored-by: Scott Cranfill <scott.cranfill@cfpb.gov>
Co-authored-by: Scott Cranfill <scott.cranfill@cfpb.gov>
@Scotchester

Copy link
Copy Markdown
Contributor

@willbarton

Copy link
Copy Markdown
MemberAuthor

Workflow templates just announced: https://github.blog/changelog/2020-06-23-github-actions-workflow-templates/

Naturally.

@willbarton

Copy link
Copy Markdown
MemberAuthor

@Scotchester I've updated this PR (and opened cfpb/.github#1) based on the GitHub Actions workflow templates. It now has screenshots of how to use the templates to hopefully cfpb/.github#1 will provide, as well as the recipes for uploading a wheel file to GitHub and the kind of git checkout that's required for setuptools-git-version (which the templates provide, but I think is worth calling out here separately too).

- name: Build the Python packages
id: build
run: |
python setup.py sdist bdist_wheel

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we document using the Python cache to speed up the build? I don't think we're actually using this yet on cfgov-refresh and its associated packages, but it'd be nice to do so.

We do have an example of using Node and Ruby caches on a design-system action.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, I'm interested in this idea, too.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh my goodness yes. I'll play with this and then get it integrated.

Comment threadguides/github-actions.md
Comment threadguides/github-actions.md
Comment threadguides/github-actions.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it worth noting in this example that it depends on the on: release trigger, which was left out of the sample code block?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yes indeed.

Comment threadguides/github-actions.md Outdated
Co-authored-by: Scott Cranfill <scott.cranfill@cfpb.gov>
@willbarton
willbarton changed the base branch from master to mainSeptember 1, 2020 14:03
Sign up for freeto 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.

5 participants

@willbarton@Scotchester@higs4281@chosak@anselmbradford