Update dependency-check-maven #376
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 | |
on: [push] | |
jobs: | |
build: | |
if: github.repository != 'tmfg/digitraffic-road' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Checkout dependencies | |
uses: actions/checkout@v4 | |
with: | |
repository: tmfg/digitraffic-build-dependencies | |
ssh-key: ${{ secrets.DEPENDENCY_SSH_KEY }} | |
path: digitraffic-build-dependencies | |
sparse-checkout: | | |
jms | |
- name: Setup dependencies | |
run: cp -R digitraffic-build-dependencies/jms/ ~/.m2/ | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: corretto | |
cache: maven | |
- name: Compile | |
run: mvn install -T1.5C git-commit-id:revision install -e -U -DskipTests=true | |
- name: Setup database | |
working-directory: dbroad | |
run: docker-compose rm db && docker-compose up -d | |
- name: Get database IP | |
run: echo "db_addr=$(docker inspect dbroad_db_1 -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}')" >> $GITHUB_ENV | |
- name: Prepare test run | |
run: cp src/test/resources/application-default.properties.template target/test-classes/application-ci.properties | |
- name: Run tests | |
timeout-minutes: 10 | |
run: | | |
mvn org.jacoco:jacoco-maven-plugin:prepare-agent test org.jacoco:jacoco-maven-plugin:report -e -U -Dmaven.gitcommitid.skip=true -Dspring.jdbc.getParameterType.ignore=true -Dspring.profiles.active=ci -Dquartz.enabled=false -Droad.datasource.url=jdbc:postgresql://${{ env.db_addr }}:5432/road | |
- name: Publish test results | |
uses: dorny/test-reporter@v1.8.0 | |
if: success() || failure() | |
with: | |
name: jUnit tests | |
path: "target/surefire-reports/*.xml" | |
reporter: java-junit | |
- name: Notify Slack | |
if: failure() | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: failure | |
text: FAILED Road build | |
fields: repo, job, took | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |