From b79dfc053deb553dff9be772854c1759cd5a1779 Mon Sep 17 00:00:00 2001 From: John Agapiou Date: Thu, 12 Sep 2024 09:12:50 -0700 Subject: [PATCH] Refactor cross-platform testing. - 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 --- .github/workflows/pypi-publish.yml | 18 +++++++++++++++--- .github/workflows/pypi-test.yml | 6 ++++-- .github/workflows/sdist-test.yml | 17 ++++++++++++++--- .github/workflows/test-concordia.yml | 15 +-------------- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 62e239af..0b28bb23 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -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 @@ -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 diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 04de36d4..b6154feb 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -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: | @@ -66,4 +67,5 @@ jobs: pip list - name: Test installation - run: pytest --pyargs concordia + run: | + pytest -n auto --pyargs concordia diff --git a/.github/workflows/sdist-test.yml b/.github/workflows/sdist-test.yml index b96b07ab..039004f6 100644 --- a/.github/workflows/sdist-test.yml +++ b/.github/workflows/sdist-test.yml @@ -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: @@ -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: | diff --git a/.github/workflows/test-concordia.yml b/.github/workflows/test-concordia.yml index 0c43a312..19349d6e 100644 --- a/.github/workflows/test-concordia.yml +++ b/.github/workflows/test-concordia.yml @@ -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