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

Add common GitHub Actions recipes #206

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add common GitHub Actions recipes #206

wants to merge 6 commits into from

Conversation

willbarton
Copy link
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 team June 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
Copy link
Member

@higs4281 higs4281 left a comment

Choose a reason for hiding this comment

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

One typo noted.

guides/github-actions.md Outdated Show resolved Hide resolved
Co-authored-by: william higgins <higs4281@users.noreply.github.com>

## Running front-end unit tests

```yml
Copy link
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.

Copy link
Member

@anselmbradford anselmbradford Jun 22, 2020

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
Member Author

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.

Copy link
Contributor

@Scotchester Scotchester left a comment

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.

README.md Outdated Show resolved Hide resolved
guides/github-actions.md Outdated Show resolved Hide resolved
willbarton and 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
Contributor

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

@willbarton
Copy link
Member Author

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

Naturally.

@willbarton
Copy link
Member Author

@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
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
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
Member Author

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.

guides/github-actions.md Show resolved Hide resolved
guides/github-actions.md Show resolved Hide resolved
guides/github-actions.md Show resolved Hide resolved
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
Copy link
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
Member Author

Choose a reason for hiding this comment

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

Yes indeed.

guides/github-actions.md Outdated Show resolved Hide resolved
Co-authored-by: Scott Cranfill <scott.cranfill@cfpb.gov>
@willbarton willbarton changed the base branch from master to main September 1, 2020 14:03
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.

5 participants