π§ͺ Continuous Integration #65
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
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
name: π§ͺ Continuous Integration | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
container: fedora:38 | |
steps: | |
- name: ποΈ Setup Dependencies | |
run: | | |
dnf install -y java-17-openjdk maven git | |
- name: π₯ Checkout | |
uses: actions/checkout@v3 | |
- name: π οΈ Checkout Workaround | |
# The Checkout GitHub action has problems when running inside of a docker container (as we do). | |
# see: https://github.com/actions/checkout/issues/363 | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: π§ͺ Unit Tests | |
run: | | |
mvn test -Dtest="CucumberUnitTest" -Dsurefire.failIfNoSpecifiedTests=false | |
- name: π§ͺ Integration Tests | |
run: | | |
mvn test -Dtest="CucumberIntegrationTest" -Dsurefire.failIfNoSpecifiedTests=false | |
- name: π Check for duplicate reports | |
id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
skip_after_successful_duplicate: true | |
concurrent_skipping: "same_content_newer" | |
- name: π Unit Test Report | |
uses: phoenix-actions/test-reporting@v8 | |
if: steps.skip_check.outputs.should_skip != 'true' && (success() || failure()) | |
with: | |
name: π Unit Test Report | |
reporter: java-junit | |
path: "**/*CucumberUnitTest.xml" | |
- name: π Integration Test Report | |
uses: phoenix-actions/test-reporting@v8 | |
if: steps.skip_check.outputs.should_skip != 'true' && (success() || failure()) | |
with: | |
name: π Integration Test Report | |
reporter: java-junit | |
path: "**/*CucumberIntegrationTest.xml" | |
- name: π Sonar Scan | |
if: github.ref == 'refs/heads/master' | |
env: | |
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} | |
SONAR_HOST_URL: ${{ vars.SONARQUBE_HOST }} | |
run: | | |
mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Demo-App-backend -Dsonar.projectName='Demo App backend' | |
- name: π€ Sonar Summary | |
if: github.ref == 'refs/heads/master' | |
run: | | |
{ | |
echo "### π€ Sonar Summary" | |
echo "${{ vars.SONARQUBE_HOST }}" | |
} >> $GITHUB_STEP_SUMMARY |