File tree Expand file tree Collapse file tree 5 files changed +68
-51
lines changed
Expand file tree Collapse file tree 5 files changed +68
-51
lines changed Original file line number Diff line number Diff line change 1- name : test, bump and publish
1+ name : bump and publish
22
33on :
4- push :
5- branches : [master]
6- pull_request :
7- branches : [master]
4+ workflow_call :
85
96jobs :
10- test :
11- runs-on : ubuntu-latest
12- steps :
13- - name : Checkout
14- uses : actions/checkout@v4
15- with :
16- fetch-depth : 0
17-
18- - name : Set up Python
19- uses : actions/setup-python@v5
20- with :
21- python-version : ' 3.11'
22-
23- - name : Install python dependencies
24- run : |
25- python -m pip install --upgrade pip
26- pip install setuptools twine wheel coveralls
27- pip install -e .[all]
28-
29- - name : Show python dependencies
30- run : |
31- pip freeze
32-
33- - name : Run tests
34- run : |
35- ./run-tests.sh
36-
377 bump :
38- outputs :
39- new_sha : ${{ steps.sha.outputs.SHA }}
40- needs : test
41- if : ${{ github.event_name == 'push' }}
428 runs-on : ubuntu-latest
439 steps :
4410 - name : Check out the repository
@@ -73,23 +39,16 @@ jobs:
7339 branch : ${{ github.ref }}
7440 tags : true
7541
76- - name : get sha
77- id : sha
78- run : |
79- sha_new=$(git rev-parse HEAD)
80- echo $sha_new
81- echo "::set-output name=SHA::$sha_new"
8242
8343 publish :
8444 needs : bump
85- if : ${{ github.event_name == 'push' }}
8645 runs-on : ubuntu-latest
8746 steps :
8847 - name : Checkout
8948 uses : actions/checkout@v4
9049 with :
9150 fetch-depth : 0
92- ref : ${{ needs.bump.outputs.new_sha }}
51+ fetch-tags : true
9352
9453 - name : Set up Python
9554 uses : actions/setup-python@v5
Original file line number Diff line number Diff line change 1+ name : Pull request master
2+
3+ on :
4+ pull_request :
5+ branches : [master]
6+
7+ jobs :
8+ python2_tests :
9+ uses : ./.github/workflows/test-python-2.yml
10+
11+ python3_tests :
12+ uses : ./.github/workflows/test-python-3.yml
Original file line number Diff line number Diff line change 1+ name : Pull request master
2+
3+ on :
4+ push :
5+ branches : [master]
6+
7+ jobs :
8+ python2_tests :
9+ uses : ./.github/workflows/test-python-2.yml
10+
11+ python3_tests :
12+ uses : ./.github/workflows/test-python-3.yml
13+
14+ bump_version :
15+ needs : [python2_tests, python3_tests]
16+ uses : ./.github/workflows/bump-and-publish.yml
17+ secrets : inherit
Original file line number Diff line number Diff line change 1- name : test (python 2.7)
1+ name : Test Python 2
22
33on :
4- push :
5- branches : [master]
6- pull_request :
7- branches : [master]
4+ workflow_call :
85
96jobs :
107 test :
1613 pip : pip
1714 steps :
1815 - name : Checkout
19- uses : actions/checkout@v2
16+ uses : actions/checkout@v4
2017 with :
2118 fetch-depth : 0
2219
3532
3633 - name : Run tests
3734 run : |
38- ./run-tests.sh
35+ ./run-tests.sh
Original file line number Diff line number Diff line change 1+ name : Test Python 3
2+
3+ on :
4+ workflow_call :
5+
6+ jobs :
7+ test :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : Checkout
11+ uses : actions/checkout@v4
12+ with :
13+ fetch-depth : 0
14+
15+ - name : Set up Python
16+ uses : actions/setup-python@v5
17+ with :
18+ python-version : ' 3.11'
19+
20+ - name : Install python dependencies
21+ run : |
22+ python -m pip install --upgrade pip
23+ pip install setuptools twine wheel coveralls
24+ pip install -e .[all]
25+
26+ - name : Show python dependencies
27+ run : |
28+ pip freeze
29+
30+ - name : Run tests
31+ run : |
32+ ./run-tests.sh
You can’t perform that action at this time.
0 commit comments