Add Python 3.8 to build matrix (#58)

* Add Python 3.8 to build matrix

* Force pipenv to use matrix Python  version

* Put release step in separate job

* Fix build.yml workflow
This commit is contained in:
François Voron
2019-11-25 12:54:32 +01:00
committed by GitHub
parent 7c87039fc7
commit 280a2e253a

View File

@ -3,12 +3,12 @@ name: Build
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
build:
test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python_version: [3.7] python_version: [3.7, 3.8]
services: services:
mongo: mongo:
@ -18,22 +18,37 @@ jobs:
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Set up Python 3.7 - name: Set up Python
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
python-version: ${{ matrix.python_version }} python-version: ${{ matrix.python_version }}
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pipenv python -m pip install --upgrade pipenv
pipenv install --dev pipenv install --python ${{ matrix.python_version }} --dev
- name: Test with pytest - name: Test with pytest
env: env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: | run: |
pipenv run pytest --cov=fastapi_users/ pipenv run pytest --cov=fastapi_users/
pipenv run codecov pipenv run codecov
release:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pipenv
pipenv install --dev
- name: Release on PyPI - name: Release on PyPI
if: startsWith(github.ref, 'refs/tags/')
env: env:
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }} FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }} FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}