-
Notifications
You must be signed in to change notification settings - Fork 3
105 lines (91 loc) · 3.06 KB
/
integration-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Integration Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-push-image:
if: github.ref == 'refs/heads/main'
name: Build and push image
uses: instill-ai/api-gateway/.github/workflows/images.yml@main
secrets: inherit
backend:
needs: build-push-image
if: github.ref == 'refs/heads/main'
name: Backends
strategy:
fail-fast: false
matrix:
component:
[mgmt-backend, pipeline-backend, model-backend, artifact-backend]
uses: instill-ai/instill-core/.github/workflows/integration-test-backend.yml@main
with:
component: ${{ matrix.component }}
target: latest
pr-head:
if: github.event_name == 'pull_request'
name: PR head branch
strategy:
fail-fast: false
matrix:
component:
[mgmt-backend, pipeline-backend, model-backend, artifact-backend]
runs-on: ubuntu-latest
steps:
# mono occupies port 8084 which conflicts with mgmt-backend
- name: Stop mono service
run: |
sudo kill -9 `sudo lsof -t -i:8084`
sudo lsof -i -P -n | grep LISTEN
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Load .env file
uses: cardinalby/export-env-action@v2
with:
envFile: .env
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v5
with:
context: .
load: true
build-args: |
SERVICE_NAME=api-gateway
GOLANG_VERSION=${{ env.GOLANG_VERSION }}
ALPINE_VERSION=${{ env.ALPINE_VERSION }}
KRAKEND_CE_VERSION=${{ env.KRAKEND_CE_VERSION }}
tags: instill/api-gateway:latest
- name: Checkout repo (instill-core)
uses: actions/checkout@v4
with:
repository: instill-ai/instill-core
- name: Load .env file (instill-core)
uses: cardinalby/export-env-action@v2
with:
envFile: .env
- name: Launch Instill Core (latest)
run: |
COMPOSE_PROFILES=all \
EDITION=local-ce:test \
RAY_LATEST_TAG=latest \
docker compose -f docker-compose.yml -f docker-compose-latest.yml up -d --quiet-pull
COMPOSE_PROFILES=all \
EDITION=local-ce:test \
docker compose -f docker-compose.yml -f docker-compose-latest.yml rm -f
- name: Install k6
run: |
curl https://github.com/grafana/k6/releases/download/v${{ env.K6_VERSION }}/k6-v${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1 && sudo cp k6 /usr/bin
- name: Run ${{ matrix.component }} integration test (latest)
run: |
git clone https://github.com/instill-ai/${{ matrix.component }}.git
cd ${{ matrix.component }}
make integration-test API_GATEWAY_URL=localhost:${API_GATEWAY_PORT}
- name: Make down Instill Core
run: |
make down