Skip to content

Commit 528e381

Browse files
Merge pull request #86 from ioannistsanaktsidis/862-adapt-pipelines
gh-actions: adapt pipelines
2 parents 7a3bd55 + 2ec0688 commit 528e381

File tree

5 files changed

+68
-51
lines changed

5 files changed

+68
-51
lines changed
Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,10 @@
1-
name: test, bump and publish
1+
name: bump and publish
22

33
on:
4-
push:
5-
branches: [master]
6-
pull_request:
7-
branches: [master]
4+
workflow_call:
85

96
jobs:
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

.github/workflows/pull-request.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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

.github/workflows/push-master.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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

.github/workflows/build-and-release-py2.yml renamed to .github/workflows/test-python-2.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
name: test (python 2.7)
1+
name: Test Python 2
22

33
on:
4-
push:
5-
branches: [master]
6-
pull_request:
7-
branches: [master]
4+
workflow_call:
85

96
jobs:
107
test:
@@ -16,7 +13,7 @@ jobs:
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

@@ -35,4 +32,4 @@ jobs:
3532
3633
- name: Run tests
3734
run: |
38-
./run-tests.sh
35+
./run-tests.sh
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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

0 commit comments

Comments
 (0)