Spring Cloud Kubernetes CI Job #321
This file contains hidden or 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: Spring Cloud Kubernetes CI Job | |
| on: | |
| push: | |
| branches: [ main, 3.2.x, 3.3.x ] | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: "Which branch should be built (empty for current branch)" | |
| required: false | |
| default: '3.3.x' | |
| type: string | |
| permissions: | |
| actions: write # Required to trigger workflows | |
| contents: read | |
| jobs: | |
| determine-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.determine.outputs.matrix }} | |
| branches: ${{ steps.determine.outputs.branches }} | |
| branch-jdk-mapping: ${{ steps.determine.outputs.branch-jdk-mapping }} | |
| steps: | |
| - name: Determine build matrix | |
| id: determine | |
| uses: spring-cloud/spring-cloud-github-actions/.github/actions/determine-matrix@main | |
| with: | |
| repository: ${{ github.repository }} | |
| event-name: ${{ github.event_name }} | |
| ref-name: ${{ github.ref_name }} | |
| branch: ${{ inputs.branch }} | |
| trigger-branch-ci: | |
| name: Trigger CI for non-default branches | |
| needs: determine-matrix | |
| if: ${{ github.event_name == 'schedule' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Dispatch CI for non-default branches | |
| uses: spring-cloud/spring-cloud-github-actions/.github/actions/trigger-branch-ci@main | |
| with: | |
| non-default-branches: ${{ needs.determine-matrix.outputs.non-default-branches }} | |
| repository: ${{ github.repository }} | |
| token: ${{ github.token }} | |
| build-and-test: | |
| name: ${{ matrix.branch }} / JDK ${{ matrix.java-version }} | |
| needs: determine-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJSON(needs.determine-matrix.outputs.matrix) }} | |
| uses: ./.github/workflows/maven.yaml | |
| with: | |
| branch: ${{ matrix.branch }} | |
| jdk-version: ${{ matrix.java-version }} | |
| should-deploy: ${{ matrix.java-version == '17' }} | |
| secrets: inherit |