Skip to content

Commit

Permalink
Merge pull request optuna#5067 from nabenabe0928/reduce-tests-mpi-to-…
Browse files Browse the repository at this point in the history
…oldest-and-latest

Reduce `tests-mpi` to the oldest and latest Python versions
  • Loading branch information
HideakiImamura authored Nov 2, 2023
2 parents 4694831 + 6a26758 commit 16e07c7
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/tests-mpi.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Tests (MPI)

on:
workflow_dispatch:
push:
branches:
- master
Expand All @@ -13,13 +14,29 @@ concurrency:
cancel-in-progress: true

jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Define workflow matrix
id: set-matrix
run: |
if [ "${{ github.event_name }}" = "schedule" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ] ; then
echo "Schedule tests (run all the versions)"
echo "matrix={\"python-version\":[\"3.8\", \"3.9\", \"3.10\", \"3.11\"]}" >> $GITHUB_OUTPUT
else
echo "PR push tests (run only the oldest and the latest versions)"
echo "matrix={\"python-version\":[\"3.8\", \"3.11\"]}" >> $GITHUB_OUTPUT
fi
tests-mpi:
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
needs: define-matrix
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
matrix: ${{fromJson(needs.define-matrix.outputs.matrix)}}

steps:
- name: Checkout
Expand Down

0 comments on commit 16e07c7

Please sign in to comment.