generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Add workflow templates, property files, and icons #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # CFPB GitHub Actions workflow templates | ||
|
|
||
| This repo houses CFPB-specific GitHub Actions workflow templates. | ||
|
|
||
| To use our workflow templates, click on the "Actions" tab in a CFPB GitHub repository. If the repository does not already have a GitHub Actions workflow, you will be presented with the option of creating one from one of our templates: | ||
|
|
||
|  | ||
|
|
||
| If the repository already has a GitHub Actions workflow, click on the "New workflow" button at the top of the workflow list on the left. | ||
|
|
||
|  | ||
|
|
||
| Then you will be presented with the option to create one from one of our templates, shown above. | ||
|
|
||
| New workflow templates can be created in [github.com/cfpb/.github](https://github.com/cfpb/.github) based on [GitHub's workflow template documentation](https://docs.github.com/en/actions/configuring-and-managing-workflows/sharing-workflow-templates-within-your-organization). | ||
|
|
||
| ## consumerfinance.gov-specific workflow templates | ||
|
|
||
| - [cfgov-frontend-ci.yml](workflow-templates/cfgov-frontend-ci.yml): A frontend CI workflow template for cf.gov satellite apps. | ||
| - [cfgov-python-satellite-ci.yml](workflow-templates/cfgov-python-satellite-ci.yml): A backend CI workflow template for cf.gov satellite apps based on tox. | ||
| - [cfgov-python-satellite-release.yml](workflow-templates/cfgov-python-satellite-release.yml): A workflow template for cf.gov satellite apps that attaches a Python wheel file to a GitHub release when the release is published. | ||
|
|
||
| ## General-purpose library workflow templates | ||
|
|
||
| - [cfpb-pypi-publish.yml](workflow-templates/cfpb-pypi-publish.yml): A workflow to publish Python packages to PyPI when a GitHub release is published. | ||
| - [cfpb-python-library-ci.yml](workflow-templates/cfpb-python-library-ci.yml): A Python CI workflow template for CFPB Python libraries based on tox. | ||
|
|
||
| ## Miscellaneous workflow templates | ||
|
|
||
| - [cfpb-mkdocs-publish.yml](workflow-templates/cfpb-mkdocs-publish.yml): A workflow template to publish MkDocs documentation to gh-pages on merges to main. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
workflow-templates/cfgov-python-satellite-ci.properties.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "name": "cf.gov satellite app backend CI workflow", | ||
| "description": "A backend CI workflow template for cf.gov satellite apps based on tox.", | ||
| "iconName": "django", | ||
| "categories": [ | ||
| "Python" | ||
| ], | ||
| "filePatterns": [ | ||
| "^setup.py$", | ||
| "^tox.ini$" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Python CI workflow | ||
|
|
||
| on: [pull_request, push] | ||
|
|
||
| jobs: | ||
| backend: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| # Add the appropriate Tox environments for the satellite here | ||
| toxenv: | ||
| - py36 | ||
| - py38 | ||
| include: | ||
| # Adjust the Python versions required for the tox environments as | ||
| # needed | ||
| - toxenv: py36-dj22 | ||
| python-version: 3.6 | ||
| - toxenv: py38-dj22 | ||
| python-version: 3.8 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install Python dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install tox | ||
|
|
||
| - name: Run back-end tests | ||
| run: | | ||
| tox | ||
| env: | ||
| TOXENV: ${{ matrix.toxenv }} |
11 changes: 11 additions & 0 deletions
11
workflow-templates/cfgov-python-satellite-release.properties.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "name": "cf.gov satellite app release workflow", | ||
| "description": "A release workflow template for cf.gov satellite apps.", | ||
| "iconName": "django", | ||
| "categories": [ | ||
| "Python" | ||
| ], | ||
| "filePatterns": [ | ||
| "setup.py$" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Our consumerfinance.gov satellite apps publish wheel files to GitHub | ||
| # when released. This is an example workflow to perform that task. | ||
| name: Publish wheel file | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
|
|
||
| # If the package has a front-end build we need to set up and install | ||
| # Node and other dependencies | ||
| - name: Set up Node | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: 10.x | ||
|
|
||
| - name: Install Node dependencies | ||
| run: | | ||
| npm install -g gulp-cli | ||
| npm config set package-lock false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: 3.6 | ||
|
|
||
| - name: Install Python dependencies | ||
| run: python -m pip install --upgrade pip wheel | ||
|
|
||
| - name: Build the packages | ||
| id: build | ||
| run: | | ||
| python setup.py sdist bdist_wheel | ||
| # Get the name of the .whl and .tar.gz files and set them as | ||
| # "outputs" of this step so we can upload them | ||
| echo "::set-output name=bdist_wheel::$(cd dist && ls *.whl)" | ||
| echo "::set-output name=sdist::$(cd dist && ls *.tar.gz)" | ||
|
|
||
| - name: Upload the wheel | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ github.event.release.upload_url }} | ||
| asset_path: dist/${{ steps.build.outputs.bdist_wheel }} | ||
| asset_name: ${{ steps.build.outputs.bdist_wheel }} | ||
| asset_content_type: application/zip | ||
|
|
||
| - name: Upload the source distribution | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ github.event.release.upload_url }} | ||
| asset_path: dist/${{ steps.build.outputs.sdist }} | ||
| asset_name: ${{ steps.build.outputs.sdist }} | ||
| asset_content_type: application/gzip | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "name": "CFPB JavaScript CI workflow", | ||
| "description": "A Javascript CI workflow template for CFPB repositories based on Gulp.", | ||
| "iconName": "nodejs", | ||
| "categories": [ | ||
| "JavaScript" | ||
| ], | ||
| "filePatterns": [ | ||
| "package.json$" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Frontend CI workflow | ||
|
|
||
| on: [pull_request, push] | ||
|
|
||
| jobs: | ||
|
|
||
| frontend: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: Set up Node | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: 12.x | ||
|
|
||
| - name: Install Node dependencies | ||
| run: | | ||
| npm config set package-lock false | ||
| npm install | ||
|
|
||
| - name: Lint front-end code | ||
| run: gulp lint | ||
|
|
||
| - name: Run front-end unit tests | ||
| run: npm test | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "name": "CFPB MkDocs publish workflow", | ||
| "description": "A workflow template to publish MkDocs documentation to gh-pages on merges to main.", | ||
| "iconName": "blank", | ||
| "filePatterns": [ | ||
| "^mkdocs.yml$" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| on: | ||
| push: | ||
| branches: | ||
| - $default-branch | ||
|
|
||
| jobs: | ||
|
|
||
| publish: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - run: | | ||
| git fetch --no-tags --prune --depth=1 origin gh-pages | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: 3.6 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r mkdocs | ||
|
|
||
| - name: Build docs | ||
| run: mkdocs build | ||
|
|
||
| - name: Publish docs | ||
| run: mkdocs gh-deploy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "name": "CFPB PyPI publish workflow", | ||
| "description": "A workflow to publish Python packages to PyPI when a GitHub release is published.", | ||
| "iconName": "python", | ||
| "categories": [ | ||
| "Python" | ||
| ], | ||
| "filePatterns": [ | ||
| "^setup.py$" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Some of our libraries get published to PyPI | ||
| # (https://github.com/cfpb/development/blob/master/guides/pypi.md) | ||
| # | ||
| # This workflow requires `TWINE_USERNAME` and `TWINE_PASSWORD` set in the | ||
| # repository as secrets. | ||
| name: Publish to PyPI | ||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| - uses: actions/checkout@v1 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: 3.8 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install twine wheel | ||
|
|
||
| - name: Build the package | ||
| run: | | ||
| python setup.py sdist bdist_wheel --universal | ||
|
|
||
| - name: Upload to PyPI | ||
| run: twine upload dist/* | ||
| env: | ||
| TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | ||
| TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "name": "CFPB Python library CI workflow", | ||
| "description": "A Python CI workflow template for CFPB Python libraries based on tox.", | ||
| "iconName": "python", | ||
| "categories": [ | ||
| "Python" | ||
| ], | ||
| "filePatterns": [ | ||
| "^setup.py$", | ||
| "^tox.ini$" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Python CI workflow | ||
|
|
||
| on: [pull_request, push] | ||
|
|
||
| jobs: | ||
| backend: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| # Add the appropriate Tox environments for the satellite here | ||
| toxenv: | ||
| - py36 | ||
| - py38 | ||
| include: | ||
| # Adjust the Python versions required for the tox environments as | ||
| # needed | ||
| - toxenv: py36 | ||
| python-version: 3.6 | ||
| - toxenv: py38 | ||
| python-version: 3.8 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install Python dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install tox | ||
|
|
||
| - name: Run back-end tests | ||
| run: | | ||
| tox | ||
| env: | ||
| TOXENV: ${{ matrix.toxenv }} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you think about reframing these as general front-end/back-end CI workflows? They offer what we would consider to be best practices for any CFPB project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do that...it felt somewhat presumptuous to me to do that (at least on the backend because it presupposes Python).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can word it in such a way that it doesn't. Maybe instead of calling them frontend/backend, it should be JavaScript/Python?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Scotchester looking at this again, I'm fine moving
cfgov-frontend-citocfpb-javascript-ci, but I think I'd like to keep the distinction between cfgov satellites and Python libraries, even if the only difference is the default of including Django in the tox matrix.