Files
2025-01-02 11:09:56 +01:00

68 lines
2.4 KiB
YAML

name: Smoke Test
on:
workflow_call:
inputs:
project:
required: true
type: string
task:
required: true
type: string
checkout_repository:
required: true
type: string
checkout_ref:
required: true
type: string
expected_to_fail:
required: false
type: boolean
default: false
jobs:
smoke_test:
name: ${{ inputs.task }}
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@v4
with:
repository: ${{ inputs.checkout_repository }}
ref: ${{ inputs.checkout_ref }}
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
java-package: 'jdk+crac'
distribution: 'zulu'
- name: Set Up CRIU
run: |
sudo chown root:root $JAVA_HOME/lib/criu
sudo chmod +s $JAVA_HOME/lib/criu
- name: Set Up Gradle
uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0
- name: Configure Gradle user.name
run: |
mkdir -p ~/.gradle
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
- name: Build
id: build
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
run: ./gradlew ${{ inputs.project }}:${{ inputs.task }}
continue-on-error: ${{ inputs.expected_to_fail }}
- name: Check Out Send Notification Action
uses: actions/checkout@v4
if: ${{ failure() || (steps.build.outcome == 'success' && inputs.expected_to_fail)}}
with:
path: ci
ref: ci
sparse-checkout: .github/actions/send-notification
- name: Send notification
uses: ./ci/.github/actions/send-notification
if: ${{ failure() || (steps.build.outcome == 'success' && inputs.expected_to_fail)}}
with:
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
task: ${{ inputs.project }}:${{ inputs.task }}
branch: ${{ inputs.checkout_ref }}
failure-url: ${{ steps.build.outputs.build-scan-url || format('{0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id) }}
outcome-description: ${{ inputs.expected_to_fail && 'passed unexpectedly' || 'failed' }}