Skip to content

Add all_tests job to be used as single requirement #6654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2023
Merged
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
71 changes: 55 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,10 @@ name: tests

on:
pull_request:
paths:
- ".github/workflows/tests.yml"
- "pymc/**.py"
- "*.py"
- "conda-envs/**"
- "codecov.yml"
- "requirements*.txt"
- "scripts/*.sh"
push:
branches: [main]
paths:
- ".github/workflows/tests.yml"
- "pymc/**.py"
- "*.py"
- "conda-envs/**"
- "codecov.yml"
- "scripts/*.sh"
branches:
- main


# Tests are split into multiple jobs to accelerate the CI.
# Different jobs should be organized to take approximately the same
Expand All @@ -30,7 +17,33 @@ on:
# enforces that test run just once per OS / floatX setting.

jobs:

changes:
name: "Check for changes"
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changes.outputs.src }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- ".github/workflows/tests.yml"
- "pymc/**.py"
- "tests/**.py"
- "*.py"
- "conda-envs/**"
- "requirements*.txt"
- "codecov.yml"
- "scripts/*.sh"

ubuntu:
needs: changes
if: ${{ needs.changes.outputs.changes == 'true' }}
strategy:
matrix:
os: [ubuntu-20.04]
Expand Down Expand Up @@ -160,7 +173,10 @@ jobs:
env_vars: TEST_SUBSET
name: ${{ matrix.os }} ${{ matrix.floatx }}
fail_ci_if_error: false

windows:
needs: changes
if: ${{ needs.changes.outputs.changes == 'true' }}
strategy:
matrix:
os: [windows-latest]
Expand Down Expand Up @@ -233,7 +249,10 @@ jobs:
env_vars: TEST_SUBSET
name: ${{ matrix.os }} ${{ matrix.floatx }}
fail_ci_if_error: false

macos:
needs: changes
if: ${{ needs.changes.outputs.changes == 'true' }}
strategy:
matrix:
os: [macos-latest]
Expand Down Expand Up @@ -309,7 +328,10 @@ jobs:
env_vars: TEST_SUBSET
name: ${{ matrix.os }} ${{ matrix.floatx }}
fail_ci_if_error: false

external_samplers:
needs: changes
if: ${{ needs.changes.outputs.changes == 'true' }}
strategy:
matrix:
os: [ubuntu-20.04]
Expand Down Expand Up @@ -379,7 +401,10 @@ jobs:
env_vars: TEST_SUBSET
name: JAX tests - ${{ matrix.os }} ${{ matrix.floatx }}
fail_ci_if_error: false

float32:
needs: changes
if: ${{ needs.changes.outputs.changes == 'true' }}
strategy:
matrix:
os: [windows-latest]
Expand Down Expand Up @@ -448,3 +473,17 @@ jobs:
env_vars: TEST_SUBSET
name: ${{ matrix.os }} ${{ matrix.floatx }}
fail_ci_if_error: false

all_tests:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [ changes, ubuntu, windows, macos, external_samplers, float32 ]
steps:
- name: Check build matrix status
if: ${{ needs.changes.outputs.changes == 'true' &&
( needs.ubuntu.result != 'success' ||
needs.windows.result != 'success' ||
needs.macos.result != 'success' ||
needs.external_samplers.result != 'success' ||
needs.float32.result != 'success' ) }}
run: exit 1