-
Notifications
You must be signed in to change notification settings - Fork 2
110 lines (100 loc) · 3.1 KB
/
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
106
107
108
109
110
name: test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
IMAGE: linkos-dev
CACHE_KEY: linkos-dev-${{ github.event.pull_request.head.sha }}
on:
pull_request:
workflow_dispatch:
jobs:
setup:
name: Build Linkos Image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Linkos
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ env.IMAGE }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar
build-args: |
DEBUG=false
TESTING=true
VERSION=dev
- name: Cache Docker Image
uses: actions/cache@v4
with:
key: ${{ env.CACHE_KEY }}
path: /tmp/${{ env.IMAGE }}.tar
e2e_api_test:
name: E2E API Test
runs-on: ubuntu-latest
needs: setup
env:
ENVIRONMENT: debug
DEFAULT_LOCAL: en
TOKEN_DRIVER: local
APP_SSL_KEY: randomLongKey
API_ENDPOINT: /v1/api
BACKUP_CRON: "* * * * *"
NANOID_LETTERS: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-"
NANOID_LENGTH: 8
KAFKA_NUMBER_OF_PARTITIONS: 1
MAIN_DOMAIN: http://localhost
APPWRITE_ENDPOINT: ${{secrets.APPWRITE_ENDPOINT}}
APPWRITE_PROJECT_ID: linkos
APPWRITE_API_KEY: ${{secrets.APPWRITE_API_KEY}}
REDIS_HOST: redis
REDIS_PORT: 6379
KAFKA_HOSTS: kafka:9092
KAFKA_CFG_NODE_ID: 0
KAFKA_CFG_PROCESS_ROLES: controller,broker
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 0@kafka:9093
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: PLAINTEXT
CLICKHOUSE_PROTOCOL: http
CLICKHOUSE_HOST: clickhouse
CLICKHOUSE_PORT: 8123
CLICKHOUSE_DB: linkos
CLICKHOUSE_USER: linkos
CLICKHOUSE_PASSWORD: strong_password
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DB: linkos
POSTGRES_USER: linkos
POSTGRES_PASSWORD: strong_password
steps:
- name: checkout
uses: actions/checkout@v4
- name: Load Cache
uses: actions/cache@v4
with:
key: ${{ env.CACHE_KEY }}
path: /tmp/${{ env.IMAGE }}.tar
fail-on-cache-miss: true
- name: Load Linkos
run: |
docker load --input /tmp/${{ env.IMAGE }}.tar
docker compose -f docker-compose.ci.yml up -d
sleep 20
- name: curl health
run: curl localhost/v1/api/health
- name: Install bun
uses: oven-sh/setup-bun@v1
- name: run tests
working-directory: ./e2e
run: bun test