This repository has been archived by the owner on Apr 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
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 #129 from spotify/travis-to-github-actions
Switch from Travis to GitHub Actions
- Loading branch information
Showing
2 changed files
with
64 additions
and
30 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,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 }} |
This file was deleted.
Oops, something went wrong.