This repository was archived by the owner on Mar 12, 2026. It is now read-only.
Add comments to all workflows #1
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
| name: Build and test the project | |
| # Workflow to run tests on the project | |
| # Triggered on push and pull request events | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| test: | |
| name: Test and push Sonar analysis | |
| runs-on: ${{ vars.UBUNTU_VERSION }} | |
| steps: | |
| # Check out the repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '0' | |
| # Set up Java environment | |
| - name: Set up Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '11' | |
| # Start MongoDB v6.0 | |
| - name: Start MongoDB v6.0 | |
| uses: supercharge/mongodb-github-action@1.8.0 | |
| with: | |
| mongodb-version: 6.0 | |
| mongodb-replica-set: rs-test | |
| # Run tests using Maven | |
| - name: Run tests | |
| run: mvn test --no-transfer-progress | |
| # Test and Analyze | |
| - name: Test and Analyze | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: mvn -B verify surefire-report:report --fail-never org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opencb_java-common-libs --no-transfer-progress | |
| # Append test summary to job summary | |
| - name: Append test summary to job summary | |
| if: success() || failure() | |
| uses: opencb/ci-core/.github/actions/test-summary@main | |
| with: | |
| report_paths: './**/surefire-reports/TEST-*.xml' | |
| title: "Java tests summary" |