-
Notifications
You must be signed in to change notification settings - Fork 100
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 #98 from graingert/github-actions
- Loading branch information
Showing
5 changed files
with
108 additions
and
34 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 |
---|---|---|
@@ -1,33 +1,80 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: CI | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the master branch | ||
on: | ||
push: | ||
branches: [ master ] | ||
branches: | ||
- master | ||
tags: | ||
- v* | ||
pull_request: | ||
branches: [ master ] | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
tox: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8] | ||
os: [macOS-latest, ubuntu-latest, windows-latest] | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# Runs a single command using the runners shell | ||
- name: Run a one-line script | ||
run: echo Hello, world! | ||
- name: Set Up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# Runs a set of commands using the runners shell | ||
- name: Run a multi-line script | ||
- name: Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
echo Add other actions to build, | ||
echo test, and deploy your project. | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
- name: pip cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.pip-cache.outputs.dir }} | ||
key: | ||
${{ runner.os }}-pip-${{ hashFiles('pyproject.toml', 'setup.py', | ||
'setup.cfg') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install | ||
run: | | ||
pip install tox | ||
- name: tox | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: tox -e py,lint,coveralls,release | ||
|
||
- name: upload dist | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.os }}_${{ matrix.python-version}}_dist | ||
path: dist | ||
|
||
all-successful: | ||
# https://github.jparrowsec.cnmunity/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert | ||
runs-on: ubuntu-latest | ||
needs: [tox] | ||
steps: | ||
- name: Download dists for PyPI | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ubuntu-latest_3.8_dist | ||
path: dist | ||
|
||
- name: Display structure of donwloaded files | ||
run: ls -R | ||
|
||
- name: Publish package | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
|
||
- name: note that all tests succeeded | ||
run: echo "🎉" |
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
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,3 @@ | ||
[build-system] | ||
requires = [ "setuptools >= 35.0.2", "wheel >= 0.29.0"] | ||
build-backend = "setuptools.build_meta" |
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