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
15 changes: 10 additions & 5 deletions .github/workflows/coverage_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ jobs:
member-name: ${{ github.event.pull_request.head.repo.owner.login }}
token: ${{ secrets.PAT }}

python-versions:
uses: ./.github/workflows/get-python-versions.yml

run-tests:
runs-on: ${{ matrix.os }}
needs: [check_for_membership]
needs: [check_for_membership, python-versions]
if: github.event_name == 'push' || needs.check_for_membership.outputs.check-result == 'true' || github.event_name == 'workflow_dispatch'
name: Run tests with Python ${{ matrix.python-version }} on ${{ matrix.os }}
strategy:
matrix:
python-version: [ '3.8', '3.12' ]
python-version:
- ${{ needs.python-versions.outputs.earliest-python-version }}
- ${{ needs.python-versions.outputs.latest-python-version }}
os: [ ubuntu-latest, windows-latest ]
fail-fast: false

Expand Down Expand Up @@ -81,20 +86,20 @@ jobs:
run: python run_tests.py

- name: Publish results to Codecov for PR coming from hazelcast organization
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request_target' }}
if: ${{ matrix.python-version == needs.python-versions.outputs.latest-python-version && matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request_target' }}
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
override_pr: ${{ github.event.pull_request.number }}

- name: Publish results to Codecov for Push
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' && github.event_name == 'push' }}
if: ${{ matrix.python-version == needs.python-versions.outputs.latest-python-version && matrix.os == 'ubuntu-latest' && github.event_name == 'push' }}
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml

- name: Publish result to Codecov for PR coming from community
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' && github.event_name == 'workflow_dispatch' }}
if: ${{ matrix.python-version == needs.python-versions.outputs.latest-python-version && matrix.os == 'ubuntu-latest' && github.event_name == 'workflow_dispatch' }}
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/get-python-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Get Python versions

on:
workflow_call:
outputs:
python-versions:
value: ${{ jobs.get-python-versions.outputs.python-versions }}
earliest-python-version:
value: ${{ jobs.get-python-versions.outputs.earliest-python-version }}
latest-python-version:
value: ${{ jobs.get-python-versions.outputs.latest-python-version }}

jobs:
get-python-versions:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.extract-versions.outputs.python-versions }}
earliest-python-version: ${{ steps.extract-versions.outputs.earliest-python-version }}
latest-python-version: ${{ steps.extract-versions.outputs.latest-python-version }}
steps:
- id: extract-versions
run: |
python_versions='[ "3.8", "3.9", "3.10", "3.11", "3.12" ]'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add 3.13 there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve no idea adding 3.13 - but could I raise a follow up PR to do that separately?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.


echo "python-versions=${python_versions}" >> $GITHUB_OUTPUT
echo "earliest-python-version=$(echo "${python_versions}" | jq --raw-output '.[0]')" >> $GITHUB_OUTPUT
echo "latest-python-version=$(echo "${python_versions}" | jq --raw-output '.[-1]')" >> $GITHUB_OUTPUT
- run: exit 0
18 changes: 12 additions & 6 deletions .github/workflows/linter_docs_mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ on:
- master
- '[45].*.z'
jobs:
python-versions:
uses: ./.github/workflows/get-python-versions.yml

run-linter:
runs-on: ubuntu-latest
needs: python-versions
name: Run black to check the code style
steps:
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: ${{ needs.python-versions.outputs.latest-python-version }}

- name: Checkout to code
uses: actions/checkout@v4
Expand All @@ -31,12 +35,13 @@ jobs:

generate_docs:
runs-on: ubuntu-latest
needs: python-versions
name: Generate documentation
steps:
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: ${{ needs.python-versions.outputs.latest-python-version }}

- name: Checkout to code
uses: actions/checkout@v4
Expand All @@ -52,12 +57,13 @@ jobs:

run-mypy:
runs-on: ubuntu-latest
needs: python-versions
name: Run mypy to check type annotations
steps:
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: ${{ needs.python-versions.outputs.latest-python-version }}

- name: Checkout to code
uses: actions/checkout@v4
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/nightly_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ on:
schedule:
- cron: '0 2 * * *'
jobs:
python-versions:
uses: ./.github/workflows/get-python-versions.yml

run-tests:
needs: python-versions
runs-on: ${{ matrix.os }}
name: Run tests with Python ${{ matrix.python-version }} on ${{ matrix.os }}
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ${{ fromJSON(needs.python-versions.outputs.python-versions) }}
os: [ ubuntu-latest, windows-latest ]
exclude:
- os: windows-latest
python-version: pypy-3.9
fail-fast: false
steps:
- name: Setup Python
Expand Down
Loading