Skip to content

Commit 158372a

Browse files
committed
Migrate pypi tests into CI workflow
1 parent b9291e5 commit 158372a

2 files changed

Lines changed: 92 additions & 9 deletions

File tree

.github/actions/install-pypi/action.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,25 @@ runs:
5656
echo "DEP_GROUPS=${{ inputs.type }}" >> $GITHUB_ENV
5757
fi
5858
59+
- name: Set install flags
60+
shell: bash
61+
run: echo "INSTALL_FLAGS=${{ env.INSTALL_FLAGS }}" >> $GITHUB_ENV
62+
63+
- name: Massage for backwards compatibility
64+
if: ${{ inputs.version-file && (inputs.install-flags == '') }}
65+
shell: bash
66+
run: echo "INSTALL_FLAGS=-c ci/${{ inputs.version-file }} -c ci-dev/${{ inputs.type }}_requirements.txt -c ci/extra_requirements.txt" >> $GITHUB_ENV
67+
5968
- name: Install
6069
shell: bash
6170
run: >
62-
uv pip install --system ${{ inputs.install-flags }} ${{ inputs.install-target }}[${{ env.DEP_GROUPS }}]
63-
-c ci/${{ inputs.version-file }} -c ci-dev/${{ inputs.type }}_requirements.txt -c ci/extra_requirements.txt
71+
uv pip install --system ${{ env.INSTALL_FLAGS }} ${{ inputs.install-target }}[${{ env.DEP_GROUPS }}]
6472
6573
- name: Install additional test tools
6674
if: ${{ inputs.type == 'test' }}
6775
shell: bash
6876
run: >
69-
uv pip install --system coverage
70-
-c ci/${{ inputs.version-file }} -c ci-dev/${{ inputs.type }}_requirements.txt -c ci/extra_requirements.txt
77+
uv pip install --system $${{ env.INSTALL_FLAGS }} coverage
7178
7279
- name: Download Cartopy Maps
7380
if: ${{ inputs.need-cartopy == 'true' }}

.github/workflows/ci.yml

Lines changed: 81 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,88 @@ jobs:
2020
Builds:
2121
uses: ./.github/workflows/packages.yml
2222

23-
TestsPyPI:
23+
PyPITests:
2424
needs: Builds
25-
uses: ./.github/workflows/tests-pypi.yml
26-
with:
27-
install-flags: --no-index --find-links ./wheelhouse/
28-
download-name: wheels-${{ runner.name }}
25+
# name: PyPI Tests
26+
name: ${{ matrix.python-version }} ${{ matrix.dep-versions }} ${{ matrix.no-extras }}
27+
runs-on: ${{ matrix.platform }}
28+
env:
29+
INSTALL_FLAGS: ''
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
platform: ["ubuntu-latest", "macos-latest", "macos-15-intel", "windows-latest", "windows-11-arm"]
34+
python-version: [3.11, 3.12, 3.13, 3.14]
35+
dep-versions: [Latest]
36+
no-extras: ['']
37+
include:
38+
- python-version: 3.11
39+
dep-versions: Minimum
40+
- python-version: 3.11
41+
dep-versions: Minimum
42+
no-extras: 'No Extras'
43+
- python-version: 3.14
44+
dep-versions: Latest
45+
no-extras: 'No Extras'
46+
47+
steps:
48+
- name: Checkout source
49+
uses: actions/checkout@v6
50+
with:
51+
fetch-depth: 150
52+
fetch-tags: true
53+
persist-credentials: false
54+
55+
- uses: actions/download-artifact@v8
56+
with:
57+
name: wheels-${{ matrix.platform }}
58+
59+
- name: Set flag to install minimum dependencies
60+
if: ${{ matrix.dep-versions == 'Minimum' }}
61+
run: echo "INSTALL_FLAGS=${{ env.INSTALL_FLAGS }} --resolution=lowest-direct" >> $GITHUB_ENV
62+
63+
- name: Set flag to constrain CI dependencies
64+
if: ${{ matrix.dep-versions == 'Latest' }}
65+
run: echo "INSTALL_FLAGS=${{ env.INSTALL_FLAGS }} -c ci/requirements.txt -c ci-dev/${{ inputs.type }}_requirements.txt -c ci/extra_requirements.txt" >> $GITHUB_ENV
66+
67+
- name: Install from PyPI
68+
uses: ./.github/actions/install-pypi
69+
with:
70+
need-extras: ${{ matrix.no-extras != 'No Extras' }}
71+
type: 'test'
72+
python-version: ${{ matrix.python-version }}
73+
old-build: ${{ matrix.no-extras != 'No Extras' && matrix.dep-versions == 'Minimum' }}
74+
need-cartopy: ${{ matrix.no-extras != 'No Extras' }}
75+
install-flags: ${{ env.INSTALL_FLAGS }}
76+
77+
- name: Run tests
78+
uses: ./.github/actions/run-tests
79+
with:
80+
run-doctests: ${{ matrix.dep-versions == 'Latest' && matrix.no-extras != 'No Extras' }}
81+
key: pypi-${{ matrix.python-version }}-${{ matrix.dep-versions }}-${{ matrix.no-extras }}-${{ runner.os }}
82+
83+
codecov:
84+
needs: PyPITests
85+
name: CodeCov Upload
86+
runs-on: ubuntu-slim
87+
environment:
88+
name: CodeCov
89+
timeout-minutes: 2
90+
steps:
91+
- name: Checkout source
92+
uses: actions/checkout@v6
93+
with:
94+
persist-credentials: false
95+
96+
- name: Download coverage artifacts
97+
uses: actions/download-artifact@v7
98+
99+
- name: Upload coverage
100+
uses: codecov/codecov-action@v5
101+
with:
102+
name: PyPI
103+
fail_ci_if_error: true
104+
token: ${{ secrets.CODECOV_TOKEN }}
29105

30106
# TestsSDist:
31107

0 commit comments

Comments
 (0)