fix the Github Actions build and the Gradle build (#58) #164
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 | |
on: [push] | |
jobs: | |
build: | |
name: Build plugin | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
cache: 'gradle' | |
- name: Download opa | |
run: wget -O opa https://openpolicyagent.org/downloads/latest/opa_linux_amd64 | |
- name: Install opa | |
run: sudo mv opa /usr/local/bin/ && sudo chmod +x /usr/local/bin/opa | |
- name: Test example rego | |
run: opa test ./src/main/rego/policy.rego ./src/test/rego/policy_test.rego | |
- name: Build plugin | |
run: ./gradlew check shadowJar | |
- name: Jacoco test report | |
run: ./gradlew jacocoTestReport | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: opa-authorizer | |
path: build/libs | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
files: ./build/reports/jacoco/test/jacocoTestReport.xml | |
name: opa-kafka-plugin | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
files: ./build/reports/opa/opa-codecov-coverage.json | |
name: opa-policies |