ci: test bun #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
name: Test | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- 'boot/**' | |
- 'web/**' | |
- '**.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
unit-test: | |
name: UniteTest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Unit Test with Gradle | |
run: ./gradlew :generator:test | |
integration-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
middleware: [ "tomcat", "jetty", "jbossas", "jbosseap", "wildfly", "glassfish", "resin", "payara" ] | |
runs-on: ubuntu-latest | |
name: ${{ matrix.middleware }} | |
needs: [ unit-test ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Integration Test with gradle | |
run: ./gradlew :integration-test:test --tests '*.${{ matrix.middleware }}.*' --info | |
- name: Export Integration Test Summary | |
run: cat integration-test/build/test-results/report.md >> $GITHUB_STEP_SUMMARY | |
- name: Upload jacoco | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.middleware }}-integration-test | |
path: integration-test/build/jacoco/test.exec | |
retention-days: 1 | |
coverage: | |
name: Coverage | |
needs: [ unit-test, integration-test ] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Unit Test with Gradle | |
run: ./gradlew :generator:test | |
- name: Download Jacoco | |
uses: actions/download-artifact@v4 | |
with: | |
path: build/jacoco | |
- name: Merge Jacoco | |
run: ./gradlew :jacocoTestReport --info | |
- name: Generate JaCoCo Badge | |
uses: cicirello/jacoco-badge-generator@v2 | |
with: | |
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv | |
badges-directory: .github/badges | |
generate-coverage-badge: false | |
generate-branches-badge: false | |
generate-coverage-endpoint: true | |
coverage-endpoint-filename: jacoco.json | |
generate-summary: true | |
summary-filename: coverage-summary.json | |
- name: Commit Badges | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
file_pattern: ".github/badges/**" | |
commit_message: "ci: update badge" |