Skip to content

Cluster

Cluster #729

Workflow file for this run

name: Build Code Samples
on:
push:
branches: ["release/3.*"]
pull_request:
branches: ["release/3.*"]
env:
JAVA_VERSION: 17
jobs:
# The pre_job uses a smart Github action that will check the provided path filters
# to determine if subsequent jobs should be "skipped" when the filters don't apply.
# This ensures that our Github branch protection rules are still satisfied and users
# can merge their PRs with skipped status checks where appropriate.
# It also provides the ability to cancel outdated workflow runs after branch pushes.
# https://github.com/marketplace/actions/skip-duplicate-actions
pre_job:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: "true" # cancel previous workflow runs when pushing a new commit.
paths: '["**/Makefile", "modules/test/**", "**/*.java", "**/pom.xml"]'
build:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
env:
working-directory: ./
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }} # The JDK version to make available on the path.
distribution: 'adopt'
# java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
# architecture: x64 # (x64 or x86) - defaults to x64
- name: Build code samples
run: make build
working-directory: ${{ env.working-directory }}
- name: Notify slack on failure
# We run this step only on the default branch
# because secrets are not accessible on PRs from forks.
# Therefore, this notification will only happen when a PR is merged.
if: failure() && startsWith(github.ref, 'refs/heads/release/3.*')
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: ":octocat: SDK Automation Failure"
text: ":no_entry: Oh noes! The commit has broken the build...please verify :paddlin:"
fields: repo,workflow,job,commit,author
mention: here
if_mention: failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}