Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,44 +1,10 @@
name: test, bump and publish
name: bump and publish

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools twine wheel coveralls
pip install -e .[all]

- name: Show python dependencies
run: |
pip freeze

- name: Run tests
run: |
./run-tests.sh

bump:
outputs:
new_sha: ${{ steps.sha.outputs.SHA }}
needs: test
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Check out the repository
Expand Down Expand Up @@ -73,23 +39,16 @@ jobs:
branch: ${{ github.ref }}
tags: true

- name: get sha
id: sha
run: |
sha_new=$(git rev-parse HEAD)
echo $sha_new
echo "::set-output name=SHA::$sha_new"

publish:
needs: bump
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.bump.outputs.new_sha }}
fetch-tags: true

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Pull request master

on:
pull_request:
branches: [master]

jobs:
python2_tests:
uses: ./.github/workflows/test-python-2.yml

python3_tests:
uses: ./.github/workflows/test-python-3.yml
17 changes: 17 additions & 0 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Pull request master

on:
push:
branches: [master]

jobs:
python2_tests:
uses: ./.github/workflows/test-python-2.yml

python3_tests:
uses: ./.github/workflows/test-python-3.yml

bump_version:
needs: [python2_tests, python3_tests]
uses: ./.github/workflows/bump-and-publish.yml
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: test (python 2.7)
name: Test Python 2

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_call:

jobs:
test:
Expand All @@ -16,7 +13,7 @@ jobs:
pip: pip
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -35,4 +32,4 @@ jobs:

- name: Run tests
run: |
./run-tests.sh
./run-tests.sh
32 changes: 32 additions & 0 deletions .github/workflows/test-python-3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test Python 3

on:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools twine wheel coveralls
pip install -e .[all]

- name: Show python dependencies
run: |
pip freeze

- name: Run tests
run: |
./run-tests.sh