Skip to content

Commit

Permalink
Run all CIs on a PR in a fork
Browse files Browse the repository at this point in the history
  • Loading branch information
HideakiImamura committed Feb 2, 2024
1 parent 53d8554 commit e702018
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 71 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/checks-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ on:
schedule:
- cron: '0 23 * * SUN-THU'
workflow_dispatch:
pull_request: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true

jobs:
checks:
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
# if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
checks:
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
# if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
runs-on: ubuntu-latest

steps:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/mac-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ jobs:
- name: Scheduled tests
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
# if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
run: |
pytest tests -m "not integration"
- name: Tests
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
run: |
pytest tests -m "not integration and not slow"
# - name: Tests
# if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
# run: |
# pytest tests -m "not integration and not slow"


tests-integration-mac:
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/tests-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ concurrency:

jobs:
tests-integration:
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
# if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
test-trigger-type:
- ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'Scheduled' || '' }}
exclude:
- test-trigger-type: ""
python-version: "3.9"
- test-trigger-type: ""
python-version: "3.10"
# test-trigger-type:
# - ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'Scheduled' || '' }}
# exclude:
# - test-trigger-type: ""
# python-version: "3.9"
# - test-trigger-type: ""
# python-version: "3.10"

steps:
- name: Checkout
Expand Down Expand Up @@ -75,11 +75,11 @@ jobs:
pipdeptree
- name: Scheduled tests
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
# if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
run: |
pytest tests -m "integration"
- name: Tests
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
run: |
pytest tests -m "integration and not slow"
# - name: Tests
# if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
# run: |
# pytest tests -m "integration and not slow"
16 changes: 8 additions & 8 deletions .github/workflows/tests-mpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ concurrency:

jobs:
tests-mpi:
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
# if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
test-trigger-type:
- ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'Scheduled' || '' }}
exclude:
- test-trigger-type: ""
python-version: "3.9"
- test-trigger-type: ""
python-version: "3.10"
# test-trigger-type:
# - ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'Scheduled' || '' }}
# exclude:
# - test-trigger-type: ""
# python-version: "3.9"
# - test-trigger-type: ""
# python-version: "3.10"

steps:
- name: Checkout
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/tests-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ jobs:
# RDB. Since current name "tests-rdbstorage" is required in the Branch protection rules, you
# need to modify the Branch protection rules as well.
tests-rdbstorage:
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
# if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
test-trigger-type:
- ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'Scheduled' || '' }}
exclude:
- test-trigger-type: ""
python-version: "3.8"
- test-trigger-type: ""
python-version: "3.9"
- test-trigger-type: ""
python-version: "3.10"
# test-trigger-type:
# - ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'Scheduled' || '' }}
# exclude:
# - test-trigger-type: ""
# python-version: "3.8"
# - test-trigger-type: ""
# python-version: "3.9"
# - test-trigger-type: ""
# python-version: "3.10"

services:
mysql:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests-with-minimum-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
tests-with-minimum-versions:
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
# if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -82,11 +82,11 @@ jobs:
pipdeptree
- name: Scheduled tests
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
# if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
run: |
pytest tests -m "not integration"
- name: Tests
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
run: |
pytest tests -m "not integration and not slow"
# - name: Tests
# if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
# run: |
# pytest tests -m "not integration and not slow"
37 changes: 19 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ concurrency:

jobs:
tests:
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
# if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
test-trigger-type:
- ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'Scheduled' || '' }}
exclude:
- test-trigger-type: ""
python-version: "3.8"
- test-trigger-type: ""
python-version: "3.9"
- test-trigger-type: ""
python-version: "3.10"
- test-trigger-type: ""
python-version: "3.11"
# test-trigger-type:
# - ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'Scheduled' || '' }}
# exclude:
# - test-trigger-type: ""
# python-version: "3.8"
# - test-trigger-type: ""
# python-version: "3.9"
# - test-trigger-type: ""
# python-version: "3.10"
# - test-trigger-type: ""
# python-version: "3.11"

services:
redis:
Expand Down Expand Up @@ -87,12 +87,13 @@ jobs:
- name: Tests
run: |
if [ "${{ github.event_name }}" = "schedule" ] || \
[ "${{ github.event_name }}" = "workflow_dispatch" ] ; then
target="not integration"
else
target="not integration and not slow"
fi
# if [ "${{ github.event_name }}" = "schedule" ] || \
# [ "${{ github.event_name }}" = "workflow_dispatch" ] ; then
# target="not integration"
# else
# target="not integration and not slow"
# fi
target="not integration"
if [ "${{ matrix.python-version }}" = "3.12" ] ; then
# TODO(not522): Remove ignores when BoTorch supports Python 3.12
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/windows-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: windows-latest

# Not intended for forks.
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
# if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -63,25 +63,25 @@ jobs:
pipdeptree
- name: Scheduled tests
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
# if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
run: |
pytest -m "not integration"
env:
SQLALCHEMY_WARN_20: 1
MPLBACKEND: "QtAgg" # Use QtAgg as matplotlib backend.

- name: Tests
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
run: |
pytest -m "not integration and not slow"
env:
MPLBACKEND: "QtAgg" # Use QtAgg as matplotlib backend.
# - name: Tests
# if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
# run: |
# pytest -m "not integration and not slow"
# env:
# MPLBACKEND: "QtAgg" # Use QtAgg as matplotlib backend.

tests-integration-windows:
runs-on: windows-latest

# Not intended for forks.
if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
# if: (github.event_name == 'schedule' && github.repository == 'optuna/optuna') || (github.event_name != 'schedule')
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down

0 comments on commit e702018

Please sign in to comment.