Integration #2337
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: Integration | |
| # Controls when the workflow will run | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '0 */6 * * *' # Every 6 hours | |
| workflow_dispatch: | |
| inputs: | |
| restateCommit: | |
| description: 'restate commit' | |
| required: false | |
| default: '' | |
| type: string | |
| restateImage: | |
| description: 'restate image, superseded by restate commit' | |
| required: false | |
| default: 'ghcr.io/restatedev/restate:main' | |
| type: string | |
| serviceImage: | |
| description: "service image, if provided it will skip building the image from sdk main branch" | |
| required: false | |
| default: "" | |
| type: string | |
| workflow_call: | |
| inputs: | |
| restateCommit: | |
| description: 'restate commit' | |
| required: false | |
| default: '' | |
| type: string | |
| restateImage: | |
| description: 'restate image, superseded by restate commit' | |
| required: false | |
| default: 'ghcr.io/restatedev/restate:main' | |
| type: string | |
| envVars: | |
| required: false | |
| type: string | |
| description: list of vars and values used when running the test tool | |
| testArtifactOutput: | |
| required: false | |
| type: string | |
| description: name of the test artifact output | |
| serviceImage: | |
| description: "service image, if provided it will skip building the image from sdk main branch" | |
| required: false | |
| default: "" | |
| type: string | |
| # temporarily needed to allow running tests that we expect to fail because we cannot specify continue-on-error on | |
| # reusable workflows. See https://github.com/orgs/community/discussions/77915. | |
| continueOnError: | |
| description: "whether to continue on error" | |
| required: false | |
| default: 'false' | |
| type: string | |
| jobs: | |
| sdk-test-suite: | |
| if: github.repository_owner == 'restatedev' | |
| runs-on: ubuntu-latest | |
| name: "Features integration test" | |
| permissions: | |
| contents: read | |
| issues: read | |
| checks: write | |
| pull-requests: write | |
| actions: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: restatedev/sdk-java | |
| - name: Set up Docker containerd snapshotter | |
| uses: docker/setup-docker-action@v4 | |
| with: | |
| version: "v28.5.2" | |
| set-host: true | |
| daemon-config: | | |
| { | |
| "features": { | |
| "containerd-snapshotter": true | |
| } | |
| } | |
| ### Download the Restate container image, if needed | |
| # Setup restate snapshot if necessary | |
| # Due to https://github.com/actions/upload-artifact/issues/53 | |
| # We must use download-artifact to get artifacts created during *this* workflow run, ie by workflow call | |
| - name: Download restate snapshot from in-progress workflow | |
| if: ${{ inputs.restateCommit != '' && github.event_name != 'workflow_dispatch' }} | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: restate.tar | |
| # In the workflow dispatch case where the artifact was created in a previous run, we can download as normal | |
| - name: Download restate snapshot from completed workflow | |
| if: ${{ inputs.restateCommit != '' && github.event_name == 'workflow_dispatch' }} | |
| uses: dawidd6/action-download-artifact@v3 | |
| with: | |
| repo: restatedev/restate | |
| workflow: ci.yml | |
| commit: ${{ inputs.restateCommit }} | |
| name: restate.tar | |
| - name: Install restate snapshot | |
| if: ${{ inputs.restateCommit != '' }} | |
| run: | | |
| output=$(docker load --input restate.tar | head -n 1) | |
| docker tag "${output#*: }" "localhost/restatedev/restate-commit-download:latest" | |
| docker image ls -a | |
| - name: Setup Java | |
| if: ${{ inputs.serviceImage == '' }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Gradle | |
| if: ${{ inputs.serviceImage == '' }} | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Build restatedev/test-services-java image | |
| if: ${{ inputs.serviceImage == '' }} | |
| run: ./gradlew -Djib.console=plain :test-services:jibDockerBuild | |
| # Pre-emptively pull the test-services image to avoid affecting execution time | |
| - name: Pull test services image | |
| if: ${{ inputs.serviceImage != '' }} | |
| shell: bash | |
| run: docker pull ${{ inputs.serviceImage }} | |
| - name: Run test tool | |
| continue-on-error: ${{ inputs.continueOnError == 'true' }} | |
| uses: restatedev/sdk-test-suite@v3.2 | |
| with: | |
| envVars: ${{ inputs.envVars }} | |
| testArtifactOutput: ${{ inputs.testArtifactOutput != '' && inputs.testArtifactOutput || 'sdk-java-integration-test-report' }} | |
| restateContainerImage: ${{ inputs.restateCommit != '' && 'localhost/restatedev/restate-commit-download:latest' || (inputs.restateImage != '' && inputs.restateImage || 'ghcr.io/restatedev/restate:main') }} | |
| serviceContainerImage: ${{ inputs.serviceImage != '' && inputs.serviceImage || 'restatedev/test-services-java' }} |