ci: Improve repo security (#551) #1014
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: Build & Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: read-all | |
jobs: | |
compile: | |
permissions: | |
contents: read | |
checks: write | |
statuses: write | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [8, 17, 23] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: Setup Java | |
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b | |
with: | |
distribution: 'corretto' | |
java-version: ${{ matrix.java }} | |
cache: maven | |
- name: Compile with Maven | |
run: mvn -e --batch-mode compile -T 1C | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [21] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: Setup Java | |
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java }} | |
cache: maven | |
- name: Test with Maven | |
run: mvn -e --batch-mode verify -T 1C | |
- name: Run Codecov | |
uses: codecov/codecov-action@288befbd1044bd1756afb0bdae077549e0ddb31f |