|
| 1 | +name: Integration |
| 2 | + |
| 3 | +# Controls when the workflow will run |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + schedule: |
| 10 | + - cron: "0 */6 * * *" # Every 6 hours |
| 11 | + workflow_dispatch: |
| 12 | + inputs: |
| 13 | + restateCommit: |
| 14 | + description: "restate commit" |
| 15 | + required: false |
| 16 | + default: "" |
| 17 | + type: string |
| 18 | + restateImage: |
| 19 | + description: "restate image, superseded by restate commit" |
| 20 | + required: false |
| 21 | + default: "ghcr.io/restatedev/restate:main" |
| 22 | + type: string |
| 23 | + workflow_call: |
| 24 | + inputs: |
| 25 | + restateCommit: |
| 26 | + description: "restate commit" |
| 27 | + required: false |
| 28 | + default: "" |
| 29 | + type: string |
| 30 | + restateImage: |
| 31 | + description: "restate image, superseded by restate commit" |
| 32 | + required: false |
| 33 | + default: "ghcr.io/restatedev/restate:main" |
| 34 | + type: string |
| 35 | + |
| 36 | +jobs: |
| 37 | + sdk-test-suite: |
| 38 | + if: github.repository_owner == 'restatedev' |
| 39 | + runs-on: ubuntu-latest |
| 40 | + name: "Features integration test (sdk-test-suite version ${{ matrix.sdk-test-suite }})" |
| 41 | + strategy: |
| 42 | + matrix: |
| 43 | + sdk-test-suite: ["1.5"] |
| 44 | + permissions: |
| 45 | + contents: read |
| 46 | + issues: read |
| 47 | + checks: write |
| 48 | + pull-requests: write |
| 49 | + actions: read |
| 50 | + |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v4 |
| 53 | + with: |
| 54 | + repository: restatedev/sdk-typescript |
| 55 | + |
| 56 | + ### Download the Restate container image, if needed |
| 57 | + # Setup restate snapshot if necessary |
| 58 | + # Due to https://github.com/actions/upload-artifact/issues/53 |
| 59 | + # We must use download-artifact to get artifacts created during *this* workflow run, ie by workflow call |
| 60 | + - name: Download restate snapshot from in-progress workflow |
| 61 | + if: ${{ inputs.restateCommit != '' && github.event_name != 'workflow_dispatch' }} |
| 62 | + uses: actions/download-artifact@v4 |
| 63 | + with: |
| 64 | + name: restate.tar |
| 65 | + # In the workflow dispatch case where the artifact was created in a previous run, we can download as normal |
| 66 | + - name: Download restate snapshot from completed workflow |
| 67 | + if: ${{ inputs.restateCommit != '' && github.event_name == 'workflow_dispatch' }} |
| 68 | + uses: dawidd6/action-download-artifact@v3 |
| 69 | + with: |
| 70 | + repo: restatedev/restate |
| 71 | + workflow: ci.yml |
| 72 | + commit: ${{ inputs.restateCommit }} |
| 73 | + name: restate.tar |
| 74 | + - name: Install restate snapshot |
| 75 | + if: ${{ inputs.restateCommit != '' }} |
| 76 | + run: | |
| 77 | + output=$(docker load --input restate.tar) |
| 78 | + docker tag "${output#*: }" "localhost/restatedev/restate-commit-download:latest" |
| 79 | + docker image ls -a |
| 80 | +
|
| 81 | + - name: Setup Java |
| 82 | + uses: actions/setup-java@v4 |
| 83 | + with: |
| 84 | + distribution: "temurin" |
| 85 | + java-version: "17" |
| 86 | + - name: Set up QEMU |
| 87 | + uses: docker/setup-qemu-action@v3 |
| 88 | + - name: Set up Docker Buildx |
| 89 | + uses: docker/setup-buildx-action@v3 |
| 90 | + - name: Setup sdk-test-suite |
| 91 | + run: wget --no-verbose https://github.com/restatedev/sdk-test-suite/releases/download/v${{ matrix.sdk-test-suite }}/restate-sdk-test-suite.jar |
| 92 | + |
| 93 | + - name: Build Typescript test-services image |
| 94 | + id: build |
| 95 | + uses: docker/build-push-action@v6 |
| 96 | + with: |
| 97 | + context: . |
| 98 | + file: "packages/restate-e2e-services/Dockerfile" |
| 99 | + push: false |
| 100 | + load: true |
| 101 | + tags: localhost/restatedev/test-services:latest |
| 102 | + cache-from: type=gha,scope=${{ github.workflow }} |
| 103 | + cache-to: type=gha,mode=max,scope=${{ github.workflow }} |
| 104 | + |
| 105 | + # Run test suite |
| 106 | + - name: Run test suite |
| 107 | + env: |
| 108 | + RESTATE_CONTAINER_IMAGE: ${{ inputs.restateCommit != '' && 'localhost/restatedev/restate-commit-download:latest' || (inputs.restateImage != '' && inputs.restateImage || 'ghcr.io/restatedev/restate:main') }} |
| 109 | + run: java -jar restate-sdk-test-suite.jar run --report-dir=test-report --exclusions-file packages/restate-e2e-services/exclusions.yaml localhost/restatedev/test-services:latest |
| 110 | + |
| 111 | + # Upload logs and publish test result |
| 112 | + - uses: actions/upload-artifact@v4 |
| 113 | + if: always() # Make sure this is run even when test fails |
| 114 | + with: |
| 115 | + name: sdk-typescript-integration-test-report |
| 116 | + path: test-report |
| 117 | + - name: Publish Test Results |
| 118 | + uses: EnricoMi/publish-unit-test-result-action@v2 |
| 119 | + if: always() |
| 120 | + with: |
| 121 | + files: | |
| 122 | + test-report/*/*.xml |
0 commit comments