Skip to content

All tests including long-running #112

All tests including long-running

All tests including long-running #112

# Nightly job, that should execute all tests (including long-running ones) when something was committed.
name: All tests including long-running
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 1' # runs on Monday morning
permissions:
contents: read # Required for actions/checkout to fetch the repository code.
actions: read # Required for the workflow to use the actions/checkout action.
checks: write # Required for the workflow to create check runs.
statuses: write # Required for the workflow to update commit statuses.
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
# inspiration from https://github.com/nvim-neorocks/luarocks-tag-release#version-optional
- name: Get new commits # initialize github env variable with count of commits into the repository that day
run: |
echo "NEW_COMMIT_COUNT=$(git log --oneline --since '168 hours ago' | wc -l)" >> $GITHUB_ENV
echo "Commits found: $NEW_COMMIT_COUNT"
- name: Setup Java JDK # this should setup JDK 17 but only if something was committed this day
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
if: ${{ env.NEW_COMMIT_COUNT != '0' }}
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Long running tests # this run Maven tests but only if something was committed this day
if: ${{ env.NEW_COMMIT_COUNT != '0' }}
run: mvn -T 1C -B package -P longRunning -V --fail-at-end -Dmaven.test.skip=false --file pom.xml
- name: Upload test results # this upload test results but only if something was committed this day
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: ${{ env.NEW_COMMIT_COUNT != '0' && always() }}
with:
name: test-results
path: 'evita*/**/target/surefire-reports/TEST-*.xml'
- name: Upload coverage to Codecov # this upload test coverage but only if something was committed this day
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
if: ${{ env.NEW_COMMIT_COUNT != '0' }}