This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Feat/migrate to gh actions #53
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
09e8081
feat: inital commit of GH Actions config
tunderwood ae52fd2
fix build trigger
tunderwood 68678a3
fix build trigger
tunderwood d49cc50
fix build trigger
tunderwood ed8889c
fix build
tunderwood df98e58
pin to 18.04
tunderwood 86c8c99
try to add coverage reporting
tunderwood 7a89ad1
Chore: Clean up files
tunderwood 9ccd66c
Remove Travis File
tunderwood d08ae70
ensure we notify slack if master branch fails
tunderwood 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 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,41 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
Build: | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
python-version: [2.7, 3.6] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install google-compute-engine | ||
pip install twine | ||
pip install -r requirements-dev.txt | ||
python setup.py install | ||
- name: Run Tests | ||
run: | | ||
nosetests --with-coverage --cover-xml tests/ | ||
- name: Upload coverage report to CodeCov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: coverage.xml # optional | ||
fail_ci_if_error: true # optional (default = false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this send a Slack notification if any tests fail? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had actually forgotten to put the slack config in so thanks for catching that. This will notify us in slack anytime the master build fails (due to failed tests, failed coverage upload, or anything else) |
||
verbose: true |
This file contains 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,53 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Build and Release | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v2 | ||
|
||
jobs: | ||
Build-And-Release: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [2.7, 3.6] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install google-compute-engine | ||
pip install twine | ||
pip install -r requirements-dev.txt | ||
python setup.py install | ||
- name: Run Tests | ||
run: | | ||
nosetests --verbosity=2 tests/ | ||
- name: Prepare for release to PyPi | ||
run: | | ||
python setup.py sdist | ||
python setup.py bdist_wheel --universal | ||
- name: Publish a Python distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: ${{ secrets.PYIP_USERNAME }} | ||
password: ${{ secrets.PYPI_PASSWORD }} | ||
- name: Slack notification when release fails | ||
if: ${{ failure() }} | ||
uses: rtCamp/action-slack-notify@v2.1.0 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_CHANNEL: cerberus-alerts | ||
SLACK_MESSAGE: 'Cerberus release workflow has failed :build-failed:' | ||
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png | ||
SLACK_TITLE: Cerberus Build Failure Notification | ||
SLACK_USERNAME: GitHub Actions |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
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.
Does this work to set up both version of 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.
Yes, it looks at the "strategy:matrix:python-version" field under Build and then creates separate workflows for each one.