forked from opentripplanner/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from ibi-group/upstream-merge-2024-11-07
Upstream merge 2024-11-07
- Loading branch information
Showing
460 changed files
with
4,859 additions
and
702 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,11 @@ on: | |
branches: | ||
- ibi-dev | ||
- ibi-dev-2.x | ||
env: | ||
# Since version 3.9.0 of Maven it will automatically understand this environment variable. | ||
# However, as of 2024-11 the latest versions of Ubuntu and Debian were on 3.8.8 so it will take some | ||
# time until we can remove the $MAVEN_ARGS below. | ||
MAVEN_ARGS: "--no-transfer-progress -Dstyle.color=always" | ||
jobs: | ||
build-linux: | ||
env: | ||
|
@@ -40,22 +45,29 @@ jobs: | |
# https://github.com/actions/runner-images/issues/1499 | ||
# we set nodePath and npmPath to skip downloading the node binary, which frequently times out | ||
run: | | ||
mvn --batch-mode jacoco:prepare-agent test jacoco:report -P prettierCheck,unit-tests -Dprettier.nodePath=node -Dprettier.npmPath=npm | ||
mvn --batch-mode package -Dmaven.test.skip -P prettierSkip | ||
mvn $MAVEN_ARGS jacoco:prepare-agent test jacoco:report -P prettierCheck,unit-tests -Dprettier.nodePath=node -Dprettier.npmPath=npm | ||
mvn $MAVEN_ARGS package -Dmaven.test.skip -P prettierSkip | ||
- name: Send coverage data to codecov.io | ||
if: github.repository_owner == 'opentripplanner' | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: target/site/jacoco/jacoco.xml | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true | ||
|
||
- name: Upload test results to Codecov | ||
# always upload test results, even when failed | ||
if: ${{ !cancelled() }} | ||
uses: codecov/test-results-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: "*TEST-*.xml" | ||
|
||
- name: Deploy to Github Package Registry | ||
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev-1.x' || github.ref == 'refs/heads/dev-2.x') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: mvn --batch-mode deploy --settings maven-settings.xml -DskipTests -DGITHUB_REPOSITORY=$GITHUB_REPOSITORY -P prettierSkip -P deployGitHub | ||
run: mvn $MAVEN_ARGS deploy --settings maven-settings.xml -DskipTests -DGITHUB_REPOSITORY=$GITHUB_REPOSITORY -P prettierSkip -P deployGitHub | ||
|
||
## IBI start | ||
# So that the branch name can be reference via $GITHUB_REF_SLUG. | ||
|
@@ -122,7 +134,7 @@ jobs: | |
- name: Configure Windows Pagefile | ||
uses: al-cheb/[email protected] | ||
- name: Run tests | ||
run: mvn --batch-mode test -P prettierSkip | ||
run: mvn $MAVEN_ARGS test -P prettierSkip | ||
|
||
docs: | ||
if: github.repository_owner == 'opentripplanner' | ||
|
@@ -235,7 +247,7 @@ jobs: | |
distribution: temurin | ||
cache: maven | ||
- name: Compile Java code | ||
run: mvn --batch-mode compile -DskipTests -P prettierSkip | ||
run: mvn $MAVEN_ARGS compile -DskipTests -P prettierSkip | ||
|
||
container-image: | ||
if: github.repository_owner == 'opentripplanner' && github.event_name == 'push' && (github.ref == 'refs/heads/dev-2.x' || github.ref == 'refs/heads/master') | ||
|
@@ -279,4 +291,4 @@ jobs: | |
MAVEN_SKIP_ARGS="-P prettierSkip -Dmaven.test.skip=true -Dmaven.source.skip=true" | ||
mvn --batch-mode $MAVEN_SKIP_ARGS package com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_version | ||
mvn $MAVEN_ARGS $MAVEN_SKIP_ARGS package com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
application/src/ext/java/org/opentripplanner/ext/sorlandsbanen/CoachCostCalculator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
application/src/main/java/org/opentripplanner/astar/strategy/MaxCountSkipEdgeStrategy.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...ication/src/main/java/org/opentripplanner/astar/strategy/MaxCountTerminationStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.opentripplanner.astar.strategy; | ||
|
||
import java.util.function.Predicate; | ||
import org.opentripplanner.astar.spi.AStarState; | ||
import org.opentripplanner.astar.spi.SearchTerminationStrategy; | ||
|
||
/** | ||
* This termination strategy is used to terminate an a-star search after a number of states matching | ||
* some criteria has been found. For example it can be used to limit a search to a maximum number of | ||
* stops. | ||
*/ | ||
public class MaxCountTerminationStrategy<State extends AStarState<State, ?, ?>> | ||
implements SearchTerminationStrategy<State> { | ||
|
||
private final int maxCount; | ||
private final Predicate<State> shouldIncreaseCount; | ||
private int count; | ||
|
||
/** | ||
* @param maxCount Terminate the search after this many matching states have been reached. | ||
* @param shouldIncreaseCount A predicate to check if a state should increase the count or not. | ||
*/ | ||
public MaxCountTerminationStrategy(int maxCount, Predicate<State> shouldIncreaseCount) { | ||
this.maxCount = maxCount; | ||
this.shouldIncreaseCount = shouldIncreaseCount; | ||
this.count = 0; | ||
} | ||
|
||
@Override | ||
public boolean shouldSearchTerminate(State current) { | ||
if (shouldIncreaseCount.test(current)) { | ||
count++; | ||
} | ||
return count >= maxCount; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.