Skip to content

Commit

Permalink
Refactor cross-platform testing.
Browse files Browse the repository at this point in the history
- Harmonize pre- and post-release testing.
- Do extensive cross-platform testing before and after release.
- Simplify continuous integration tests to only run on ubuntu-latest.

PiperOrigin-RevId: 673875278
Change-Id: I1045a233bd66b0ef60707d8086c5d925791fa07d
  • Loading branch information
jagapiou authored and copybara-github committed Sep 12, 2024
1 parent ab3cb8c commit b79dfc0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,20 @@ jobs:
name: Test
needs: build
if: github.event_name == 'release' || inputs.run_tests
runs-on: ubuntu-latest
timeout-minutes: 60
runs-on: ${{ matrix.os }}
env:
SYSTEM_VERSION_COMPAT: 0 # See https://github.com/actions/setup-python/issues/279.
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os:
- macos-12
- macos-latest
- ubuntu-20.04
- ubuntu-latest
python-version:
- '3.11'
steps:
- name: Load artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
Expand All @@ -58,7 +70,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.11'
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
pip install --upgrade pip
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ jobs:
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install pytest-xdist setuptools
pip install --upgrade setuptools
pip install pytest-xdist
- name: Install from PyPI
run: |
Expand All @@ -66,4 +67,5 @@ jobs:
pip list
- name: Test installation
run: pytest --pyargs concordia
run: |
pytest -n auto --pyargs concordia
17 changes: 14 additions & 3 deletions .github/workflows/sdist-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ name: sdist-test

on:
workflow_dispatch:
inputs:
runs-on:
description: 'OS to run on.'
type: string
default: 'ubuntu-latest'
python-version:
description: 'Python version to use.'
type: string
default: '3.11'

permissions: read-all

jobs:
sdist-test:
name: Test sdist
runs-on: ubuntu-latest
runs-on: ${{ inputs.runs-on }}
timeout-minutes: 90

steps:
Expand All @@ -23,16 +32,18 @@ jobs:
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.11'
python-version: ${{ inputs.python-version }}

- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install pytest-xdist setuptools
pip install --upgrade setuptools
pip install pytest-xdist
- name: Install source distribution
run: |
pip install dist/*.tar.gz
pip list
- name: Test source distribution
run: |
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/test-concordia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,13 @@ permissions: read-all
jobs:
test-concordia:
name: Test Concordia
runs-on: ${{ matrix.os }}
env:
SYSTEM_VERSION_COMPAT: 0 # See https://github.com/actions/setup-python/issues/279.
timeout-minutes: 120
strategy:
fail-fast: ${{ github.event_name != 'workflow_dispatch' }}
matrix:
os:
- macos-12
- ubuntu-20.04
python-version:
- '3.11'
runs-on: ubuntu-latest
steps:
- name: Checkout Concordia
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Install Concordia
uses: ./.github/actions/install-concordia
with:
python-version: ${{ matrix.python-version }}

- name: Test Concordia
run: pytest concordia
Expand Down

0 comments on commit b79dfc0

Please sign in to comment.