Skip to content

Commit

Permalink
workflow change
Browse files Browse the repository at this point in the history
  • Loading branch information
hvalev committed Jan 16, 2021
1 parent 8d3d6cd commit 5fdd08d
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 62 deletions.
93 changes: 36 additions & 57 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,38 @@
name: deploy
on:
push:
paths-ignore:
- 'README.md'
tags:
- '*'
workflow_dispatch:
inputs:
test:
description: "Testing pipeline"
required: true
default: "test.yml"
# name: deploy
# on:
# push:
# paths-ignore:
# - 'README.md'
# tags:
# - '*'
# workflow_dispatch:
# inputs:
# test:
# description: "Testing pipeline"
# required: true
# default: "test.yml"


jobs:
build-n-publish:
name: Publish Python distribution
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Setup Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Lint with flake8
run: |
pip install flake8
flake8 . --max-line-length=1000
- name: Test with pytest
run: |
pip install pytest
pip install pytest-cov
pytest ./tests/tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
# jobs:
# build-n-publish:
# name: Publish Python distribution
# runs-on: ubuntu-18.04
# steps:
# - uses: actions/checkout@master
# - name: Setup Python 3.9
# uses: actions/setup-python@v1
# with:
# python-version: 3.9
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# - name: Lint with flake8
# run: |
# pip install flake8
# flake8 . --max-line-length=1000
# - name: Test with pytest
# run: |
# pip install pytest
# pip install pytest-cov
# pytest ./tests/tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html

46 changes: 41 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
name: test
name: test and publish
on:
push:
tags:
- 'v*'
paths-ignore:
- 'README.md'

jobs:
build-n-publish:
name: Publish Python distribution
test:
name: Set up python matrix for testing
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@master
- name: Setup Python 3.6
- name: Setup Python Matrix
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -39,4 +41,38 @@ jobs:
# name: codecov-umbrella # optional
# fail_ci_if_error: true # optional (default = false)
# verbose: true # optional (default = false)

build:
name: Publish Python distribution
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Setup Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install pypa/build
needs: test
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}

0 comments on commit 5fdd08d

Please sign in to comment.