[issue-719] Explicitly cancel outstanding checkpoints when checkpoint… #659
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, pull_request, workflow_dispatch] | |
# workflow_dispatch should make manually triggered ci/cd possible | |
# workflow file (like this) with `workflow_dispatch` after on should exist on the **master** or default branch, | |
# or there will be no ui for a manual trigger. https://github.community/t/workflow-dispatch-event-not-working/128856/2 | |
env: | |
GRADLE_OPTS: "-Xms128m -Xmx1024m" | |
ORG_GRADLE_PROJECT_logOutput: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# pull all the commits, so the commit count of the artifact name will be correct | |
fetch-depth: 0 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11' # major or semver Java version will be acceptable, see https://github.com/marketplace/actions/setup-java-jdk#basic | |
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk | |
architecture: x64 # (x64 or x86) - defaults to x64 | |
- name: Cache gradle modules | |
uses: actions/cache@v2 | |
with: | |
# gradle packages that need to be cached | |
path: | | |
.gradle | |
$HOME/.gradle | |
$HOME/.m2 | |
# key to identify the specific cache | |
# so if we upgrade some modules, the key(hash) of `gradle.properties` will change | |
# and we will rerun the download to get the newest packages | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
# build cache is used when we need to publish the artifact | |
- name: Cache build outputs | |
uses: actions/cache@v2 | |
with: | |
path: ./* | |
key: ${{ github.run_id }} | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build via Gradle | |
run: ./gradlew clean build | |
- name: Report to Codecov | |
run: bash <(curl -s https://codecov.io/bash) -t 9c42ff48-d98f-4444-af05-cf734aa1dbd0 | |
snapshot: | |
name: Publish snapshot to Github Packages | |
needs: [build] | |
runs-on: ubuntu-latest | |
# only publish the snapshot when it is a push on the master or the release branch (starts with r0.x or r1.x) | |
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/r0.') || startsWith(github.ref, 'refs/heads/r1.')) }} | |
env: | |
BINTRAY_USER: ${{ secrets.BINTRAY_USER }} | |
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }} | |
steps: | |
# gradle packages that need to be cached | |
- name: Cache gradle modules | |
uses: actions/cache@v2 | |
with: | |
path: | | |
.gradle | |
$HOME/.gradle | |
$HOME/.m2 | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
# publish the artifact from the build cache | |
- name: Cache build outputs | |
uses: actions/cache@v2 | |
with: | |
path: ./* | |
key: ${{ github.run_id }} | |
- name: Publish to Github Packages | |
run: ./gradlew publish -PpublishUrl=https://maven.pkg.github.com/${{github.repository}} -PpublishUsername=${{github.actor}} -PpublishPassword=${{secrets.GITHUB_TOKEN}} |