Skip to content

Commit ce5cae0

Browse files
CI: run tests on all supported platforms (#280)
The plugin is currently tested against every supported version of Python, but only on linux_amd64. Expand this to cover every supported version of Python on the other four platforms.
1 parent 76f0172 commit ce5cae0

File tree

2 files changed

+48
-14
lines changed

2 files changed

+48
-14
lines changed

.github/workflows/plugin.yaml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,67 @@ on:
44
- pull_request
55
jobs:
66
test-wheel_resolver:
7-
name: Test wheel_resolver (Python ${{ matrix.python }})
7+
name: Test wheel_resolver (${{ matrix.platform }}, Python ${{ matrix.python }})
88
uses: ./.github/workflows/plugin_test.yaml
99
with:
1010
id: wheel_resolver
11-
runner: ubuntu-latest
11+
platform: ${{ matrix.platform }}
1212
python: ${{ matrix.python }}
1313
please_pex_from_repo: false
1414
test_targets: //tools/wheel_resolver/...
1515
strategy:
1616
fail-fast: false
1717
matrix:
18+
platform:
19+
- darwin_amd64
20+
- darwin_arm64
21+
- freebsd_amd64
22+
- linux_amd64
23+
- linux_arm64
1824
python:
1925
- '3.10'
2026
- '3.11'
2127
- '3.12'
2228
- '3.13'
2329
- '3.14'
2430
test-please_pex:
25-
name: Test (Python ${{ matrix.python }}, in-repo please_pex)
31+
name: Test (${{ matrix.platform}}, Python ${{ matrix.python }}, in-repo please_pex)
2632
uses: ./.github/workflows/plugin_test.yaml
2733
with:
28-
runner: ubuntu-latest
34+
platform: ${{ matrix.platform }}
2935
python: ${{ matrix.python }}
3036
please_pex_from_repo: true
3137
strategy:
3238
fail-fast: false
3339
matrix:
40+
platform:
41+
- darwin_amd64
42+
- darwin_arm64
43+
- freebsd_amd64
44+
- linux_amd64
45+
- linux_arm64
3446
python:
3547
- '3.10'
3648
- '3.11'
3749
- '3.12'
3850
- '3.13'
3951
- '3.14'
4052
test:
41-
name: Test (Python ${{ matrix.python }}, stable please_pex release)
53+
name: Test (${{ matrix.platform}}, Python ${{ matrix.python }}, stable please_pex release)
4254
uses: ./.github/workflows/plugin_test.yaml
4355
with:
44-
runner: ubuntu-latest
56+
platform: ${{ matrix.platform }}
4557
python: ${{ matrix.python }}
4658
please_pex_from_repo: false
4759
strategy:
4860
fail-fast: false
4961
matrix:
62+
platform:
63+
- darwin_amd64
64+
- darwin_arm64
65+
- freebsd_amd64
66+
- linux_amd64
67+
- linux_arm64
5068
python:
5169
- '3.10'
5270
- '3.11'

.github/workflows/plugin_test.yaml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on:
55
description: "A identifier for this test run. Will be included in the Please log archive file name."
66
type: string
77
default: test
8-
runner:
9-
description: "The GitHub runner type on which this workflow should run."
8+
platform:
9+
description: "The platform on which this workflow should run. Must be one of darwin_amd64, darwin_arm64, freebsd_amd64, linux_amd64 or linux_arm64."
1010
required: true
1111
type: string
1212
python:
13-
description: "The Python version to configure the plugin to use. Must be a value of python-version recognised by the actions/setup-python action."
13+
description: "The major Python version to configure the plugin to use."
1414
required: true
1515
type: string
1616
please_pex_from_repo:
@@ -25,9 +25,10 @@ on:
2525
jobs:
2626
test:
2727
name: Run tests
28-
runs-on: ${{ inputs.runner }}
28+
runs-on: ${{ (inputs.platform == 'freebsd_amd64' || inputs.platform == 'linux_amd64') && 'ubuntu-24.04' || (inputs.platform == 'linux_arm64' && 'ubuntu-24.04-arm' || (inputs.platform == 'darwin_amd64' && 'macos-15-intel' || (inputs.platform == 'darwin_arm64' && 'macos-15' || 'unknown'))) }}
2929
steps:
3030
- name: Install Python in CI environment
31+
if: ${{ inputs.platform != 'freebsd_amd64' }}
3132
id: python
3233
uses: actions/setup-python@v6
3334
with:
@@ -37,15 +38,30 @@ jobs:
3738
uses: actions/checkout@v5
3839
- name: Configure plugin's default Python interpreter
3940
run: |
40-
echo "PLZ_ARGS=-o plugin.python.defaultinterpreter:${{ steps.python.outputs.python-path }}" >> $GITHUB_ENV
41+
_python_path="${{ inputs.platform == 'freebsd_amd64' && format('python{0}', inputs.python) || steps.python.outputs.python-path }}"
42+
echo "PLZ_ARGS=-o plugin.python.defaultinterpreter:$_python_path" >> $GITHUB_ENV
4143
- name: Configure plugin to use please_pex tool built from source
4244
if: inputs.please_pex_from_repo
4345
run: |
4446
echo "PLZ_ARGS=${PLZ_ARGS:+$PLZ_ARGS }-o plugin.python.pextool://tools/please_pex" >> $GITHUB_ENV
45-
- name: Run tests
46-
run: ./pleasew test --keep_going --log_file plz-out/log/test.log ${{ inputs.test_targets }}
47+
- name: Run tests (in nested runner)
48+
if: ${{ inputs.platform == 'freebsd_amd64' }}
49+
uses: cross-platform-actions/action@v0.30.0
50+
with:
51+
operating_system: freebsd
52+
architecture: x86-64
53+
version: '14.3'
54+
image_url: https://github.com/please-build/freebsd-builder/releases/download/v0.12.0-please.3/freebsd-14.3-x86-64.qcow2
55+
shell: bash
56+
environment_variables: PLZ_ARGS
57+
shutdown_vm: true
58+
run: ./pleasew test --keep_going --log_file plz-out/log/test.log ${{ inputs.test_targets }}
59+
- name: Run tests (on host)
60+
if: ${{ inputs.platform != 'freebsd_amd64' }}
61+
run: |
62+
./pleasew test --keep_going --log_file plz-out/log/test.log ${{ inputs.test_targets }}
4763
- name: Archive logs
4864
uses: actions/upload-artifact@v4
4965
with:
50-
name: logs-${{ inputs.id }}-python_${{ inputs.python }}-please_pex_${{ inputs.please_pex_from_repo && 'repo' || 'stable' }}
66+
name: logs-${{ inputs.id }}-${{ inputs.platform }}-python_${{ inputs.python }}-please_pex_${{ inputs.please_pex_from_repo && 'repo' || 'stable' }}
5167
path: plz-out/log

0 commit comments

Comments
 (0)