|
| 1 | +name: Java CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + - '[6-9]+.[1-9]+.x' |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + - '[6-9]+.[1-9]+.x' |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + java: ['7'] |
| 17 | + env: |
| 18 | + WORKSPACE: ${{ github.workspace }} |
| 19 | + GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8 |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v2 |
| 22 | + - uses: actions/cache@v2 |
| 23 | + with: |
| 24 | + path: ~/.gradle/caches |
| 25 | + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} |
| 26 | + restore-keys: | |
| 27 | + ${{ runner.os }}-gradle- |
| 28 | + - name: Set up JDK |
| 29 | + uses: actions/setup-java@v1 |
| 30 | + with: |
| 31 | + java-version: ${{ matrix.java }} |
| 32 | + - name: Optional setup step |
| 33 | + run: | |
| 34 | + [ -f ./setup.sh ] && ./setup.sh || true |
| 35 | + - name: Run Tests |
| 36 | + run: | |
| 37 | + ./gradlew --no-daemon --refresh-dependencies clean check |
| 38 | + - name: Publish Test Report |
| 39 | + uses: scacap/action-surefire-report@v1 |
| 40 | + with: |
| 41 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 42 | + report_paths: '**/build/test-results/test/TEST-*.xml' |
| 43 | + - name: Run Assemble |
| 44 | + if: success() && github.event_name == 'push' && matrix.java == '7' |
| 45 | + run: ./gradlew assemble |
| 46 | + - name: Publish to repo.grails.org |
| 47 | + if: success() && github.event_name == 'push' && matrix.java == '7' |
| 48 | + env: |
| 49 | + SECRING_FILE: ${{ secrets.SECRING_FILE }} |
| 50 | + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} |
| 51 | + SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} |
| 52 | + GRAILS_CENTRAL_USERNAME: ${{ secrets.GRAILS_CENTRAL_USERNAME }} |
| 53 | + GRAILS_CENTRAL_PASSWORD: ${{ secrets.GRAILS_CENTRAL_PASSWORD }} |
| 54 | + run: | |
| 55 | + echo $SECRING_FILE | base64 -d > secring.gpg |
| 56 | + ./gradlew -Dorg.gradle.internal.publish.checksums.insecure=true -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="secring.gpg" publish |
| 57 | + - name: Extract branch name |
| 58 | + if: success() && github.event_name == 'push' && matrix.java == '7' |
| 59 | + id: extract_branch |
| 60 | + run: echo ::set-output name=value::${GITHUB_REF:11} |
| 61 | + - name: Create Snapshot Message for the Workflow Dispatch |
| 62 | + if: success() && github.event_name == 'push' && matrix.java == '7' |
| 63 | + id: dispatch_message |
| 64 | + run: echo ::set-output name=value::{\"message\":\"New Core Snapshot $(date) - $GITHUB_SHA\"} |
| 65 | + - name: Invoke the Java CI workflow in GORM Hibernate5 |
| 66 | + if: success() && github.event_name == 'push' && matrix.java == '7' |
| 67 | + |
| 68 | + with: |
| 69 | + workflow: Java CI |
| 70 | + repo: grails/gorm-hibernate5 |
| 71 | + ref: ${{ steps.extract_branch.outputs.value }} |
| 72 | + token: ${{ secrets.GH_TOKEN }} |
| 73 | + inputs: ${{ steps.dispatch_message.outputs.value }} |
| 74 | + - name: Invoke the Java CI workflow in GORM MongoDB |
| 75 | + if: success() && github.event_name == 'push' && matrix.java == '7' |
| 76 | + |
| 77 | + with: |
| 78 | + workflow: Java CI |
| 79 | + repo: grails/gorm-mongodb |
| 80 | + ref: ${{ steps.extract_branch.outputs.value }} |
| 81 | + token: ${{ secrets.GH_TOKEN }} |
| 82 | + inputs: ${{ steps.dispatch_message.outputs.value }} |
| 83 | + - name: Invoke the Java CI workflow in GORM Neo4j |
| 84 | + if: success() && github.event_name == 'push' && matrix.java == '7' |
| 85 | + |
| 86 | + with: |
| 87 | + workflow: Java CI |
| 88 | + repo: grails/gorm-neo4j |
| 89 | + ref: ${{ steps.extract_branch.outputs.value }} |
| 90 | + token: ${{ secrets.GH_TOKEN }} |
| 91 | + inputs: ${{ steps.dispatch_message.outputs.value }} |
0 commit comments