Skip to content

next step

next step #6906

Workflow file for this run

name: verify-push
on:
push:
branches-ignore:
- 'master' # no need to run after merging to master
tags-ignore:
- '*' # do not run on pushing tags (see deploy-on-release-created)
pull_request:
jobs:
build:
# run if push or pull_requests from fork
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
module:
- contribs/drt-extensions
steps:
- name: Checkout git repo
uses: actions/checkout@v4
- name: Detect changes against master
# we only want to build matsim (module) if changes are not limited to contribs
id: detect-changes
uses: dorny/paths-filter@v2
if: ${{matrix.module == 'matsim'}}
with:
filters: |
outside-contribs:
- '!contribs/**'
- name: Setup Java
if: ${{matrix.module != 'matsim' || steps.detect-changes.outputs.outside-contribs == 'true'}}
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
cache: 'maven'
- name: Build module (with dependencies)
if: ${{matrix.module != 'matsim' || steps.detect-changes.outputs.outside-contribs == 'true'}}
run: mvn install --batch-mode --also-make --projects ${{matrix.module}} -DskipTests -Dsource.skip
- name: Test module
if: ${{matrix.module != 'matsim' || steps.detect-changes.outputs.outside-contribs == 'true'}}
run: mvn verify --batch-mode -Dmatsim.preferLocalDtds=true -Dsource.skip
working-directory: ${{matrix.module}}
- name: Get output
uses: actions/upload-artifact@v3
with:
name: output
path: test/output/org/matsim/contrib/drt/extension/prebooking/PrebookingExampleIT/testElectricDrtWithPrebooking/output_events.xml.gz
env:
MAVEN_OPTS: -Xmx2g
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