Skip to content

Commit 8a24880

Browse files
Update python-package.yml
1 parent cf12395 commit 8a24880

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
tags:
1212
- v[0-9]+.[0-9]+.[0-9]+*
1313
pull_request:
14-
branches: [ "main"]
14+
branches: [ "main","development"]
15+
types: [opened, reopened]
1516

1617
jobs:
17-
test:
18+
test-and-lint:
19+
name: Test and lint package
1820
runs-on: ubuntu-latest
1921
strategy:
2022
fail-fast: false
@@ -30,17 +32,11 @@ jobs:
3032
cache: 'pip'
3133
cache-dependency-path: |
3234
**/requirements*.txt
35+
3336
- name: Install dependencies
3437
run: |
3538
python -m pip install --upgrade pip
3639
python -m pip install .[test,tox_gh,tox,mypy,flake8]
37-
- name: Test with tox
38-
run: |
39-
tox run
40-
env:
41-
CORBADO_BACKEND_API: ${{ secrets.CORBADO_BACKEND_API }}
42-
CORBADO_API_SECRET: ${{ secrets.CORBADO_API_SECRET }}
43-
CORBADO_PROJECT_ID: ${{ secrets.CORBADO_PROJECT_ID }}
4440
4541
# Linting step only runs for Python 3.8
4642
- name: mypy
@@ -49,9 +45,19 @@ jobs:
4945
- name: lint with flake8
5046
if: matrix.python-version == '3.8'
5147
run: flake8 .
48+
49+
- name: Test with tox
50+
run: |
51+
tox run
52+
env:
53+
CORBADO_BACKEND_API: ${{ secrets.CORBADO_BACKEND_API }}
54+
CORBADO_API_SECRET: ${{ secrets.CORBADO_API_SECRET }}
55+
CORBADO_PROJECT_ID: ${{ secrets.CORBADO_PROJECT_ID }}
56+
5257

5358
build:
54-
name: Build distribution package
59+
if: startsWith(github.ref, 'refs/tags/v') # only make separate build and upload for tag pushes
60+
name: Build and upload distribution package
5561
runs-on: ubuntu-latest
5662

5763
steps:
@@ -81,7 +87,7 @@ jobs:
8187
name: >-
8288
Publish Python distribution package to PyPI
8389
if: startsWith(github.ref, 'refs/tags/v') # only publish to PyPI on tag pushes
84-
needs: [build,test] # Ensure that package was built and tested for all python versions before publishing
90+
needs: [build,test-and-lint] # Ensure that package was built and tested for all python versions before publishing
8591
runs-on: ubuntu-latest
8692
environment:
8793
name: pypi

0 commit comments

Comments
 (0)