Skip to content

Commit

Permalink
TravisCI -> GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
skwashd committed Aug 14, 2022
1 parent 0fa8aa0 commit 136fe4e
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 28 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yaml
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
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
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
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

0 comments on commit 136fe4e

Please sign in to comment.