-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from skwashd/fix-ci
Migrate CI from Travis to GitHub Actions
- Loading branch information
Showing
5 changed files
with
89 additions
and
29 deletions.
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,56 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
|
||
pull_request: | ||
branches: [main] | ||
|
||
pull_request_target: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- ready_for_review | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
max-parallel: 8 | ||
fail-fast: false | ||
matrix: | ||
python-version: # Only supported versions of CPython are tested. | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11.0-rc.1" # Our one exception to the rule | ||
|
||
steps: | ||
- name: Checkout Code | ||
if: ${{ github.event_name != 'pull_request_target' }} | ||
uses: actions/checkout@v3 | ||
|
||
- name: Checkout PR | ||
if: ${{ github.event_name == 'pull_request_target' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Dependencies | ||
run: pip install -e . | ||
|
||
- name: Run Tests | ||
run: | | ||
ERROR_COUNT="$(flake8 --select=S tests | wc -l)" | ||
if [ "$ERROR_COUNT" != "495" ]; then | ||
echo "Unexpected error count: ${ERROR_COUNT}" | ||
exit 1 | ||
fi |
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,32 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-22.04 | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
|
||
steps: | ||
- name: Checkout Code | ||
if: ${{ github.event_name != 'pull_request_target' }} | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install pypa/build | ||
run: pip install build | ||
|
||
- name: Build a binary wheel and a source tarball | ||
run: python -m build --sdist --wheel --outdir dist/ . | ||
|
||
- name: Publish Package on PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
skip_existing: true |
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
Binary file not shown.