zitadel/.github/workflows/integration.yml

51 lines
1.8 KiB
YAML
Raw Normal View History

2023-04-26 17:12:58 +00:00
name: Integration tests
on:
push:
2023-04-26 17:12:58 +00:00
tags-ignore:
2023-04-26 17:29:43 +00:00
- '**'
pull_request:
branches:
- '**'
jobs:
2023-05-02 16:24:24 +00:00
run:
strategy:
matrix:
db: [cockroach, postgres]
runs-on: ubuntu-20.04
env:
DOCKER_BUILDKIT: 1
2023-04-26 16:54:47 +00:00
INTEGRATION_DB_FLAVOR: ${{ matrix.db }}
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Source checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver: docker
install: true
- name: Generate gRPC definitions
run: docker build -f build/grpc/Dockerfile -t zitadel-base:local .
- name: Copy gRPC definitions
run: docker build -f build/zitadel/Dockerfile . -t zitadel-go-base --target go-copy -o .
- name: Download Go modules
run: go mod download
- name: Start ${{ matrix.db }} database
2023-05-02 16:24:24 +00:00
run: docker compose -f internal/integration/config/docker-compose.yaml up --wait ${INTEGRATION_DB_FLAVOR}
2023-04-26 16:54:47 +00:00
- name: Run zitadel init and setup
run: |
go run main.go init --config internal/integration/config/zitadel.yaml --config internal/integration/config/${INTEGRATION_DB_FLAVOR}.yaml
go run main.go setup --masterkey MasterkeyNeedsToHave32Characters --config internal/integration/config/zitadel.yaml --config internal/integration/config/${INTEGRATION_DB_FLAVOR}.yaml
- name: Run integration tests
2023-04-27 09:03:57 +00:00
run: go test -tags=integration -race -parallel 1 -v -coverprofile=profile.cov -coverpkg=./... ./internal/integration ./internal/api/grpc/...
2023-04-26 17:12:58 +00:00
- name: Publish go coverage
uses: codecov/codecov-action@v3.1.0
with:
file: profile.cov
name: integration-tests