Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #129 from spotify/travis-to-github-actions
Browse files Browse the repository at this point in the history
Switch from Travis to GitHub Actions
  • Loading branch information
ocsw committed Jul 2, 2021
2 parents 650ed1e + 29c9c79 commit 0fea23f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 30 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Python package

# Run on all pushes, releases, and manual triggers; don't include PRs because
# then everything runs twice (push and PR)
# Push also includes manual tagged pushes to master that are how we have been
# doing releases
on: [push, release, workflow_dispatch]

jobs:
review:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.6]
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('*requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tox
# Run all tox targets; if we had more python versions we'd need
# 'tox -e py' to pick up the current python version from the matrix,
# and then separate commands (restricted to one python version) for
# the docs and manifest
run: tox

build_and_publish:
needs: review
runs-on: ubuntu-18.04
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Set up cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-build
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish package
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

0 comments on commit 0fea23f

Please sign in to comment.