Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare integration.yaml for embedding in runtime repo #22

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
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
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

jobs:
sdk-test-suite:
if: github.repository_owner == 'restatedev'
runs-on: ubuntu-latest
name: "Features integration test (sdk-test-suite version ${{ matrix.sdk-test-suite }})"
strategy:
matrix:
sdk-test-suite: [ "1.4" ]
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read

steps:
- uses: actions/checkout@v4
with:
repository: restatedev/sdk-go

### 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)
docker tag "${output#*: }" "localhost/restatedev/restate-commit-download:latest"
docker image ls -a
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup ko
uses: ko-build/[email protected]
- name: Setup sdk-test-suite
run: wget --no-verbose https://github.com/restatedev/sdk-test-suite/releases/download/v${{ matrix.sdk-test-suite }}/restate-sdk-test-suite.jar

# Build docker image
- name: Install dependencies
run: go get .
- name: Build Docker image
run: KO_DOCKER_REPO=restatedev ko build -B -L github.com/restatedev/sdk-go/test-services

# Run test suite
- name: Run test suite
env:
RESTATE_CONTAINER_IMAGE: ${{ inputs.restateCommit != '' && 'localhost/restatedev/restate-commit-download:latest' || (inputs.restateImage != '' && inputs.restateImage || 'ghcr.io/restatedev/restate:main') }}
run: java -jar restate-sdk-test-suite.jar run --report-dir=test-report --exclusions-file test-services/exclusions.yaml restatedev/test-services

# Upload logs and publish test result
- uses: actions/upload-artifact@v4
if: always() # Make sure this is run even when test fails
with:
name: test-report
path: test-report
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
test-report/*/*.xml
46 changes: 0 additions & 46 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,49 +23,3 @@ jobs:
run: go build -v ./...
- name: Test with the Go CLI
run: go test -v ./...

sdk-test-suite:
runs-on: ubuntu-latest
name: "Integration Test (Test tool ${{ matrix.sdk-test-suite }})"
strategy:
matrix:
sdk-test-suite: [ "1.4" ]

steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup ko
uses: ko-build/[email protected]
- name: Setup sdk-test-suite
run: wget --no-verbose https://github.com/restatedev/sdk-test-suite/releases/download/v${{ matrix.sdk-test-suite }}/restate-sdk-test-suite.jar

# Build docker image
- name: Install dependencies
run: go get .
- name: Build Docker image
run: KO_DOCKER_REPO=restatedev ko build -B -L github.com/restatedev/sdk-go/test-services

# Run test suite
- name: Run test suite
run: java -jar restate-sdk-test-suite.jar run --report-dir=test-report --exclusions-file test-services/exclusions.yaml restatedev/test-services

# Upload logs and publish test result
- uses: actions/upload-artifact@v4
if: always() # Make sure this is run even when test fails
with:
name: test-report
path: test-report
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
test-report/*/*.xml
Loading