-
Notifications
You must be signed in to change notification settings - Fork 217
66 lines (53 loc) · 1.96 KB
/
run-e2e-tests.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
name: Run E2E tests
on:
pull_request:
paths:
- 'agenta-backend/**'
- 'agenta-web/**'
- 'docker-compose.yml'
- 'docker-compose.*.yml'
workflow_dispatch:
inputs:
debug:
description: 'Run Docker logs step (true/false)'
required: true
default: 'false'
env:
OPENAI_API_KEY: ${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }}
jobs:
cypress:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set Environment Variables
run: |
echo "NEXT_PUBLIC_OPENAI_API_KEY=${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }}" >> $GITHUB_ENV
- name: Install Curl & Start Docker Compose
env:
NEXT_PUBLIC_OPENAI_API_KEY: ${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }}
run: |
sudo apt install curl -y
OPENAI_API_KEY=${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }} ENVIRONMENT=github docker compose -f "docker-compose.test.yml" up -d --build
- name: Restart Backend Service To Fetch Template(s)
run: docker container restart agenta-backend-test
- name: Wait for Backend Service
run: curl http://localhost/api/health/
- name: Know the Response of Organization & Container Templates
run: |
curl http://localhost/api/organizations/own/
curl http://localhost/api/containers/templates/
- name: Set Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Frontend Dependencies
run: |
cd agenta-web/ && npm install
- name: Run Cypress
env:
NEXT_PUBLIC_OPENAI_API_KEY: ${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }}
run: cd agenta-web/ && npm run test
- name: Docker logs
if: github.event_name == 'workflow_dispatch' && github.event.inputs.debug == 'true'
run: docker ps -q | xargs -I {} docker logs {}