chore: add CI/CVE badges and fix NVD cache key strategy #23
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: CI | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 | |
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: gradle | |
| - name: Build and test | |
| run: ./gradlew build | |
| - name: Publish test results | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # ratchet:actions/upload-artifact@v7 | |
| with: | |
| name: test-reports | |
| path: "**/build/reports/tests/test/" | |
| retention-days: 14 | |
| e2e-test: | |
| runs-on: ubuntu-latest | |
| # E2E tests spin up containers; only run on push/PR to the main branches | |
| # to avoid burning minutes on every feature branch commit. | |
| if: > | |
| github.ref == 'refs/heads/main' || | |
| github.ref == 'refs/heads/jetty' || | |
| github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 | |
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: gradle | |
| - name: Run e2e tests | |
| run: ./gradlew :jgit-proxy-server:e2eTest | |
| timeout-minutes: 5 | |
| - name: Publish e2e test results | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # ratchet:actions/upload-artifact@v7 | |
| with: | |
| name: e2e-test-reports | |
| path: "jgit-proxy-server/build/reports/tests/e2eTest/" | |
| retention-days: 14 |