-
Notifications
You must be signed in to change notification settings - Fork 73
89 lines (82 loc) · 2.54 KB
/
Copy pathci.yaml
File metadata and controls
89 lines (82 loc) · 2.54 KB
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
name: CI pipeline
on:
push:
branches:
- main
- 'release/**'
- develop
- 'feature/**'
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
comment:
description: "Purpose of the manual run:"
required: false
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@1a6d90ebcb0e6a6b1d87e37ba693fe453195ae25
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
test:
name: Cypress
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment
run: |
cp .env.example .env
sed -i.bak '/^DEMO_DATASET=/d;/^BE_TAG=/d;/^FE_TAG=/d;/^SECRET_KEY=/d' .env
rm -f .env.bak
echo 'SECRET_KEY=cypressci' >> .env
echo 'DEMO_DATASET=true' >> .env
echo 'DB_TAG=25.04' >> .env
echo 'BE_TAG=develop' >> .env
echo 'FE_TAG=develop' >> .env
echo 'DOMAIN=localhost' >> .env
echo 'HOSTS=localhost' >> .env
cp .env.openSearch.example .env.openSearch
docker compose up -d
echo "Waiting for 'Starting Django...' in backend logs..."
BACKEND_CONTAINER=$(docker compose ps -q backend)
for i in {1..30}; do
if docker logs $BACKEND_CONTAINER 2>&1 | grep -q "Starting Django..."; then
echo "Server is ready"
exit 0
fi
echo "Not ready yet... retry $i/30"
docker logs --tail 50 $BACKEND_CONTAINER || true
sleep 10
done
echo "Server did not start in 5 minutes"
docker logs $BACKEND_CONTAINER || true
exit 1
- name: Cypress run
uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c
with:
record: false
parallel: false
wait-on: 'http://localhost/front/'
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-artifacts
path: |
cypress/screenshots/**
cypress/videos/**
cypress/reports/**