Skip to content

reduce unwanted randomness #197

reduce unwanted randomness

reduce unwanted randomness #197

Workflow file for this run

name: Java CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
merge_group:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module:
- useCases/fabiland
- useCases/austin
- useCases/bangkok
- useCases/berlinBrandenburg
- useCases/capeTown
- useCases/kagawa
- useCases/manchester
- useCases/maryland
- useCases/munich
- useCases/perth
- siloCore
- analysis
- extensions
- synthetic-population
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'
cache: 'maven'
- name: Install HDF5 native dependencies (for hdf-java)
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev
# - name: Build with Maven
# run: mvn test --fail-at-end --batch-mode -Dmatsim.preferLocalDtds=true
# the orriginal command
- name: Build module (with dependencies)
run: mvn install --batch-mode --also-make --projects ${{matrix.module}} -DskipTests -Dsource.skip
- name: Test module
run: mvn verify --batch-mode -Dmaven.test.redirectTestOutputToFile -Dmatsim.preferLocalDtds=true --fail-at-end -Dsource.skip
working-directory: ${{matrix.module}}
- name: Sanitize module name for artifact
if: failure()
id: sanitize
run: echo "name=$(echo '${{ matrix.module }}' | tr '/' '-')" >> $GITHUB_OUTPUT
- name: Upload test output on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: test-output-${{ steps.sanitize.outputs.name }}
path: |
${{ matrix.module }}/test/output/
${{ matrix.module }}/target/surefire-reports/
retention-days: 5
env:
MAVEN_OPTS: -Xmx2g
test_all:
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- run: |
if [[ "${{ needs.build.result }}" != "success" ]]; then
exit 1
fi
# the following is what matsim-libs has. Don't know why it is needed. kai, apr'26
# verify-all-jobs-successful:
# # always() - to ensure this job is executed (regardless of the status of the previous job)
# # run if push or pull_requests from fork
# if: always() && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
# needs: build
# runs-on: ubuntu-latest
# # When running this workflow for internal PRs "verify-all-jobs-successful" is marked as skipped,
# # which GitHub takes as a green flag and will allow merging before "verify-all-jobs-successful"
# # is completed for the push event.
# # One way to avoid this is to create a job from a matrix on the fly. They will be created for
# # push events and PR events from forks (but not for PR events coming from internal forks),
# # so we can safely add a check "verify-all-jobs-successful (push-or-external-PR)"
# strategy:
# matrix:
# name: [ "push-or-external-PR" ]
# steps:
# - name: check if the whole job matrix is successful
# if: needs.build.result != 'success'
# run: exit 1 # fail if "build" was not successful