Merge branch 'nyu_dev' of https://github.com/nyudlts/fda8 into nyu_dev #26
This file contains hidden or 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
| # DSpace Continuous Integration/Build via GitHub Actions | |
| # Concepts borrowed from | |
| # https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-java-with-maven | |
| name: Build | |
| # Run this Build for all pushes / PRs to current branch | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| # Give Maven 1GB of memory to work with | |
| MAVEN_OPTS: "-Xmx1024M" | |
| strategy: | |
| # Create a matrix of two separate configurations for Unit vs Integration Tests | |
| # This will ensure those tasks are run in parallel | |
| # Also specify version of Java to use (this can allow us to optionally run tests on multiple JDKs in future) | |
| matrix: | |
| include: | |
| # NOTE: Unit Tests include a retry for occasionally failing tests | |
| # - surefire.rerunFailingTestsCount => try again for flakey tests, and keep track of/report on number of retries | |
| - type: "Unit Tests" | |
| java: 17 | |
| mvnflags: "-DskipUnitTests=false -Dsurefire.rerunFailingTestsCount=2" | |
| resultsdir: "**/target/surefire-reports/**" | |
| # NOTE: ITs skip all code validation checks, as they are already done by Unit Test job. | |
| # - enforcer.skip => Skip maven-enforcer-plugin rules | |
| # - checkstyle.skip => Skip all checkstyle checks by maven-checkstyle-plugin | |
| # - license.skip => Skip all license header checks by license-maven-plugin | |
| # - xml.skip => Skip all XML/XSLT validation by xml-maven-plugin | |
| # - failsafe.rerunFailingTestsCount => try again for flakey tests, and keep track of/report on number of retries | |
| - type: "Integration Tests" | |
| java: 17 | |
| mvnflags: "-DskipIntegrationTests=false -Denforcer.skip=true -Dcheckstyle.skip=true -Dlicense.skip=true -Dxml.skip=true -Dfailsafe.rerunFailingTestsCount=2" | |
| resultsdir: "**/target/failsafe-reports/**" | |
| # Do NOT exit immediately if one matrix job fails | |
| # This ensures ITs continue running even if Unit Tests fail, or visa versa | |
| fail-fast: false | |
| name: Run ${{ matrix.type }} | |
| # These are the actual CI steps to perform per job | |
| steps: | |
| # https://github.com/actions/checkout | |
| - name: Checkout codebase | |
| uses: actions/checkout@v4 | |
| # https://github.com/actions/setup-java | |
| - name: Install JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java }} | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| # Run parallel Maven builds based on the above 'strategy.matrix' | |
| - name: Run Maven ${{ matrix.type }} | |
| env: | |
| TEST_FLAGS: ${{ matrix.mvnflags }} | |
| run: mvn --no-transfer-progress -V install -P-assembly -Pcoverage-report $TEST_FLAGS |