Add an http status check on form updates as they default to success when it could fail #613
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
name: Build and test | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
paths-ignore: | |
- '**/*.md' | |
concurrency: | |
group: build-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
checks: write | |
security-events: write | |
jobs: | |
build-and-test: | |
if: always() | |
strategy: | |
matrix: | |
java: [ '17', '20' ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Run build and unit tests | |
run: mvn -T1C --no-transfer-progress --color=always -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -am -pl nflow-jetty,nflow-netty,nflow-metrics test | |
- name: Publish JUnit test report | |
uses: scacap/action-surefire-report@v1 | |
if: always() | |
with: | |
check_name: 'Unit Test Report for Java ${{ matrix.java }}' | |
build-and-test-nflow-explorer: | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Run build and unit tests | |
run: mvn -T1C --no-transfer-progress --color=always -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -am -pl nflow-explorer test | |
javadoc-spotbugs-codeql: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: java, javascript | |
config-file: ./.github/codeql-config.yaml | |
- name: Generate JavaDocs and run SpotBugs | |
run: mvn -T1C --no-transfer-progress --color=always -Dmaven.source.skip=true -Dskip.npm -Dskip.bower -Dskip.grunt compile javadoc:javadoc spotbugs:check | |
- name: Publish SpotBugs report | |
uses: kpresler/spotbugs-github-action@master | |
with: | |
name: 'SpotBugs Report' | |
path: '**/spotbugsXml.xml' | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 | |
integration-tests: | |
if: always() | |
strategy: | |
matrix: | |
java: [ '17', '20' ] | |
db: [ 'h2', 'mariadb', 'postgresql', 'mysql', 'sqlserver', 'db2', 'oracle' ] | |
runs-on: ubuntu-latest | |
env: | |
SPRING_PROFILES_ACTIVE: nflow.db.${{ matrix.db }} | |
DB_VERSION: ${{ matrix.java == 17 && 'old' || 'latest' }} | |
steps: | |
- name: Check out | |
uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Set up database | |
run: ./scripts/setup-db-${{ matrix.db }}.sh | |
- name: Build | |
run: mvn -T1C --color=always -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true --am -pl nflow-tests install | |
- name: Run the integration tests | |
run: mvn -T1C -Dsurefire.forkcount=2C --color=always -P ${{ matrix.db }} -rf :nflow-tests surefire:test | |
- name: Publish JUnit test report | |
uses: scacap/action-surefire-report@v1 | |
if: always() | |
with: | |
check_name: 'Integration Test Report for Java ${{ matrix.java }} and ${{ matrix.db }}' | |
- name: Upload test files as artifact | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: 'integrationtest-results-java${{ matrix.java }}-${{ matrix.db }}' | |
path: '**/target/surefire-reports/*.xml' | |
retention-days: 7 |