Add support for collecting coverage data and exporting LCOV reports (… #232
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 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| checks: write | |
| contents: write | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| gradle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| cache: gradle | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Run Gradle Build | |
| working-directory: ./Src/java | |
| run: ./gradlew check publish sonar | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ vars.OSSRH_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| - name: Publish Test Report | |
| uses: mikepenz/action-junit-report@v5 | |
| if: success() || failure() # always run even if the previous step fails | |
| with: | |
| report_paths: '**/build/test-results/test/TEST-*.xml' | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Compile Kotlin/JS cql-to-elm library for the playground | |
| working-directory: ./Src/java | |
| run: ./gradlew cql-to-elm:compileProductionLibraryKotlinJs cql-to-elm:compileProductionLibraryKotlinWasmJs | |
| - name: Install Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '24' | |
| package-manager-cache: false | |
| - name: Install playground dependencies | |
| working-directory: ./Src/js/cql-to-elm-ui | |
| run: npm ci -f | |
| - name: Build and export playground | |
| working-directory: ./Src/js/cql-to-elm-ui | |
| run: npm run build | |
| - name: Add .nojekyll | |
| run: touch ./Src/js/cql-to-elm-ui/out/.nojekyll | |
| - name: Deploy playground to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./Src/js/cql-to-elm-ui/out | |
| destination_dir: playground |