name: CI-init-script-check on: push: branches: - 'main' - 'release/**' paths-ignore: - 'dist/**' pull_request: workflow_dispatch: permissions: contents: read jobs: test-init-scripts: runs-on: ubuntu-latest steps: - name: Checkout sources uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 # Detect whether anything relevant to the init-script tests changed. # The workflow always runs (so it always reports a status check, making it safe # to mark as required), but the heavy steps below are skipped on pull requests # that don't touch the init-scripts. Pushes and manual runs always execute fully. - name: Check for relevant changes id: changes if: github.event_name == 'pull_request' uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | .github/workflows/ci-init-script-check.yml sources/src/resources/init-scripts/** sources/test/init-scripts/** - name: Setup Java if: steps.changes.outputs.any_changed == 'true' || github.event_name != 'pull_request' uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5.3.0 with: distribution: temurin java-version: 17 - name: Setup Gradle if: steps.changes.outputs.any_changed == 'true' || github.event_name != 'pull_request' # Use a released version to avoid breakages uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0 env: ALLOWED_GRADLE_WRAPPER_CHECKSUMS: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # Invalid wrapper jar used for testing - name: Run integration tests if: steps.changes.outputs.any_changed == 'true' || github.event_name != 'pull_request' working-directory: sources/test/init-scripts run: ./gradlew check