This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
95 lines (89 loc) · 3.09 KB
/
pull_request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Tests PRs on multiple operating systems and Python/Java versions
name: Test Build
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
branches:
- main
paths-ignore:
- 'LICENSE*'
- '.gitignore'
- '**.md'
- '**.adoc'
- '*.txt'
- '.ci/**'
defaults:
run:
shell: bash
jobs:
test-build:
strategy:
matrix:
os: [ ubuntu-latest ]
java-version: [ 17, 21, 22 ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
# Need to check for stale repo, since Github is not aware of the build chain and therefore doesn't automate it.
- name: Checkout timefold-solver (PR) # Checkout the PR branch first, if it exists
id: checkout-solver
uses: actions/checkout@v4
continue-on-error: true
with:
repository: ${{ github.actor }}/timefold-solver
ref: ${{ github.head_ref }}
path: ./timefold-solver
fetch-depth: 0 # Otherwise merge will fail on account of not having history.
- name: Checkout timefold-solver (main) # Checkout the main branch if the PR branch does not exist
if: steps.checkout-solver.outcome != 'success'
uses: actions/checkout@v4
with:
repository: TimefoldAI/timefold-solver
ref: main
path: ./timefold-solver
fetch-depth: 0 # Otherwise merge will fail on account of not having history.
- name: Prevent stale fork of timefold-solver
env:
BLESSED_REPO: "timefold-solver"
BLESSED_BRANCH: ${{ endsWith(github.head_ref, '.x') && github.head_ref || 'main' }}
shell: bash
working-directory: ./timefold-solver
run: .github/scripts/prevent_stale_fork.sh
- name: Check out repository code
uses: actions/checkout@v4
with:
path: './timefold-solver-python'
# Build and test
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: 'maven'
# Need to install all Python versions in the same run for tox
- name: Python 3.10, Python 3.11, Python 3.12 Setup
uses: actions/setup-python@v5
with:
python-version: |
3.10
3.11
3.12
cache: 'pip'
cache-dependency-path: |
**/setup.py
- name: Install tox
run:
python -m pip install --upgrade pip
pip install tox pytest
- name: Quickly build timefold-solver
working-directory: ./timefold-solver
run: mvn -B -Dquickly clean install
- name: Build with Maven to install parent poms for python build
working-directory: ./timefold-solver-python
run: mvn -B --fail-at-end clean install
- name: Run tox on timefold solver python test suite
working-directory: ./timefold-solver-python
run: python -m tox
- name: Run tox on jpyinterpreter test suite
working-directory: ./timefold-solver-python/jpyinterpreter
run: python -m tox