mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-28 11:48:43 -06:00
288 lines
7.2 KiB
YAML
288 lines
7.2 KiB
YAML
name: test
|
|
on: pull_request
|
|
jobs:
|
|
generate:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DATABASE_URL: postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Protoc
|
|
uses: arduino/setup-protoc@v3
|
|
with:
|
|
version: "25.2"
|
|
|
|
- name: Install Task
|
|
uses: arduino/setup-task@v2
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v3
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
|
|
- name: Install openapi generator
|
|
run: |
|
|
npm install @openapitools/openapi-generator-cli -g
|
|
openapi-generator-cli version-manager set 7.3.0
|
|
|
|
- name: Compose
|
|
run: docker compose up -d
|
|
|
|
- name: Generate
|
|
run: |
|
|
go run github.com/steebchen/prisma-client-go migrate deploy
|
|
task generate-all
|
|
|
|
- name: Check for diff
|
|
run: git diff --exit-code
|
|
|
|
- name: Teardown
|
|
run: docker compose down
|
|
|
|
unit:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Protoc
|
|
uses: arduino/setup-protoc@v3
|
|
with:
|
|
version: "25.1"
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
|
|
- name: Go deps
|
|
run: go mod download
|
|
|
|
- name: Generate
|
|
run: go generate ./...
|
|
|
|
- name: Test
|
|
run: go test ./... -v -failfast
|
|
|
|
integration:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DATABASE_URL: postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Protoc
|
|
uses: arduino/setup-protoc@v3
|
|
with:
|
|
version: "25.1"
|
|
|
|
- name: Install Task
|
|
uses: arduino/setup-task@v2
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v3
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
|
|
- name: Install openapi generator
|
|
run: |
|
|
npm install @openapitools/openapi-generator-cli -g
|
|
openapi-generator-cli version-manager set 7.3.0
|
|
|
|
- name: Compose
|
|
run: docker compose up -d
|
|
|
|
- name: Go deps
|
|
run: go mod download
|
|
|
|
- name: Generate
|
|
run: |
|
|
go run github.com/steebchen/prisma-client-go db push
|
|
|
|
task generate-all
|
|
task generate-certs
|
|
task generate-local-encryption-keys
|
|
|
|
- name: Test
|
|
run: go test -tags integration ./... -v -failfast
|
|
|
|
- name: Teardown
|
|
run: docker compose down
|
|
|
|
e2e:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
env:
|
|
DATABASE_URL: postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Task
|
|
uses: arduino/setup-task@v2
|
|
|
|
- name: Install Protoc
|
|
uses: arduino/setup-protoc@v3
|
|
with:
|
|
version: "25.1"
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v3
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
|
|
- name: Install openapi generator
|
|
run: |
|
|
npm install @openapitools/openapi-generator-cli -g
|
|
openapi-generator-cli version-manager set 7.3.0
|
|
|
|
- name: Compose
|
|
run: docker compose up -d
|
|
|
|
- name: Go deps
|
|
run: go mod download
|
|
|
|
- name: Generate
|
|
run: |
|
|
go run github.com/steebchen/prisma-client-go migrate deploy
|
|
task generate-all
|
|
task generate-certs
|
|
task generate-local-encryption-keys
|
|
|
|
- name: Prepare
|
|
run: |
|
|
cat > .env <<EOF
|
|
HATCHET_CLIENT_TENANT_ID=707d0855-80ab-4e1f-a156-f1c4546cbf52
|
|
DATABASE_URL="postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet"
|
|
HATCHET_CLIENT_TLS_ROOT_CA_FILE=./hack/dev/certs/ca.cert
|
|
HATCHET_CLIENT_TLS_SERVER_NAME="cluster"
|
|
SERVER_TLS_CERT_FILE=./hack/dev/certs/cluster.pem
|
|
SERVER_TLS_KEY_FILE=./hack/dev/certs/cluster.key
|
|
SERVER_TLS_ROOT_CA_FILE=./hack/dev/certs/ca.cert
|
|
SERVER_ENCRYPTION_MASTER_KEYSET_FILE=./hack/dev/encryption-keys/master.key
|
|
SERVER_ENCRYPTION_JWT_PRIVATE_KEYSET_FILE=./hack/dev/encryption-keys/private_ec256.key
|
|
SERVER_ENCRYPTION_JWT_PUBLIC_KEYSET_FILE=./hack/dev/encryption-keys/public_ec256.key
|
|
|
|
DATABASE_URL='postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet'
|
|
SERVER_PORT=8080
|
|
SERVER_URL=http://localhost:8080
|
|
|
|
SERVER_AUTH_COOKIE_SECRETS="kPpegRDNpofgkUsr HoWe67haMOF5qnaB"
|
|
SERVER_AUTH_COOKIE_DOMAIN=app.dev.hatchet-tools.com
|
|
SERVER_AUTH_COOKIE_INSECURE=false
|
|
SERVER_AUTH_SET_EMAIL_VERIFIED=true
|
|
EOF
|
|
|
|
- name: Run engine
|
|
run: |
|
|
set -a
|
|
. .env
|
|
set +a
|
|
|
|
go run ./cmd/hatchet-admin quickstart
|
|
|
|
go run ./cmd/hatchet-engine --config ./generated/ &
|
|
go run ./cmd/hatchet-api --config ./generated/ &
|
|
sleep 30
|
|
|
|
- name: Test
|
|
run: |
|
|
go test -tags e2e ./... -p 1 -v -failfast
|
|
|
|
- name: Teardown
|
|
run: docker compose down
|
|
|
|
load:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
env:
|
|
DATABASE_URL: postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Task
|
|
uses: arduino/setup-task@v2
|
|
|
|
- name: Install Protoc
|
|
uses: arduino/setup-protoc@v3
|
|
with:
|
|
version: "25.1"
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v3
|
|
with:
|
|
version: 8
|
|
run_install: false
|
|
|
|
- name: Compose
|
|
run: docker compose up -d
|
|
|
|
- name: Go deps
|
|
run: go mod download
|
|
|
|
- name: Generate
|
|
run: |
|
|
go run github.com/steebchen/prisma-client-go migrate deploy
|
|
task generate-all
|
|
task generate-certs
|
|
task generate-local-encryption-keys
|
|
|
|
- name: Prepare
|
|
run: |
|
|
cat > .env <<EOF
|
|
DATABASE_URL='postgresql://hatchet:hatchet@127.0.0.1:5431/hatchet'
|
|
SERVER_TLS_CERT_FILE=./hack/dev/certs/cluster.pem
|
|
SERVER_TLS_KEY_FILE=./hack/dev/certs/cluster.key
|
|
SERVER_TLS_ROOT_CA_FILE=./hack/dev/certs/ca.cert
|
|
SERVER_PORT=8080
|
|
SERVER_URL=http://localhost:8080
|
|
SERVER_AUTH_COOKIE_SECRETS="something something"
|
|
SERVER_AUTH_COOKIE_DOMAIN=app.dev.hatchet-tools.com
|
|
SERVER_AUTH_COOKIE_INSECURE=false
|
|
SERVER_AUTH_SET_EMAIL_VERIFIED=true
|
|
EOF
|
|
|
|
- name: Setup
|
|
run: |
|
|
set -a
|
|
. .env
|
|
set +a
|
|
|
|
go run ./cmd/hatchet-admin quickstart --generated-config-dir ./generated/
|
|
|
|
- name: Test
|
|
run: |
|
|
export HATCHET_CLIENT_TOKEN="$(go run ./cmd/hatchet-admin token create --config ./generated/ --tenant-id 707d0855-80ab-4e1f-a156-f1c4546cbf52)"
|
|
|
|
go test -tags load ./... -p 1 -v -race -failfast
|
|
|
|
- name: Teardown
|
|
run: docker compose down
|