Skip to content

Commit 522a64d

Browse files
authored
Merge pull request #5 from febus982/reusable-python-workflow
Reusable python test workflow
2 parents 9b90e63 + 20e0190 commit 522a64d

File tree

6 files changed

+48
-100
lines changed

6 files changed

+48
-100
lines changed

.github/workflows/python-3.10.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,6 @@ on:
1313

1414
jobs:
1515
test:
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- uses: actions/checkout@v3
20-
- name: Set up Python 3.10
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: "3.10"
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
poetry install --no-root --with dev
30-
- name: Test with pytest
31-
run: |
32-
make ci-test
33-
- name: Check typing
34-
run: |
35-
make typing
16+
uses: ./.github/workflows/reusable-python-test.yml
17+
with:
18+
python-version: "3.10"

.github/workflows/python-3.11.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,6 @@ on:
1313

1414
jobs:
1515
test:
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- uses: actions/checkout@v3
20-
- name: Set up Python 3.11
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: "3.11"
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
poetry install --no-root --with dev
30-
- name: Test with pytest
31-
run: |
32-
make ci-test
33-
- name: Check typing
34-
run: |
35-
make typing
16+
uses: ./.github/workflows/reusable-python-test.yml
17+
with:
18+
python-version: "3.11"

.github/workflows/python-3.12.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,6 @@ on:
1313

1414
jobs:
1515
test:
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- uses: actions/checkout@v3
20-
- name: Set up Python 3.12
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: "3.12"
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
poetry install --no-root --with dev
30-
- name: Test with pytest
31-
run: |
32-
make ci-test
33-
- name: Check typing
34-
run: |
35-
make typing
16+
uses: ./.github/workflows/reusable-python-test.yml
17+
with:
18+
python-version: "3.12"

.github/workflows/python-3.8.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,6 @@ on:
1313

1414
jobs:
1515
test:
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- uses: actions/checkout@v3
20-
- name: Set up Python 3.8
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: "3.8"
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
poetry install --no-root --with dev
30-
- name: Test with pytest
31-
run: |
32-
make ci-test
33-
- name: Check typing
34-
run: |
35-
make typing
16+
uses: ./.github/workflows/reusable-python-test.yml
17+
with:
18+
python-version: "3.8"

.github/workflows/python-3.9.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,6 @@ on:
1313

1414
jobs:
1515
test:
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- uses: actions/checkout@v3
20-
- name: Set up Python 3.9
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: "3.9"
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
poetry install --no-root --with dev
30-
- name: Test with pytest
31-
run: |
32-
make ci-test
33-
- name: Check typing
34-
run: |
35-
make typing
16+
uses: ./.github/workflows/reusable-python-test.yml
17+
with:
18+
python-version: "3.9"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
python-version:
9+
required: true
10+
type: string
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ inputs.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "${{ inputs.python-version }}"
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install poetry
26+
poetry config virtualenvs.create false
27+
poetry install --no-root --with dev
28+
- name: Test with pytest
29+
run: |
30+
make ci-test
31+
- name: Check typing
32+
run: |
33+
make typing

0 commit comments

Comments
 (0)