-
Notifications
You must be signed in to change notification settings - Fork 28
63 lines (60 loc) · 1.73 KB
/
ci.yaml
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
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/sonarcloud-github-action@master
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
echo 'DEMO_DATASET=true' >> .env
cp .env.lightning.example .env.lightning
docker compose up -d db
source .env
source .env.lightning
echo "Waiting for database to be healthy..."
until [ "`docker inspect -f {{.State.Health.Status}} ${PROJECT_NAME:-openimis}-db`" == "healthy" ]; do
sleep 2;
done
echo "Database is ready"
docker compose run -e PGPASSWORD=${POSTGRES_PASSWORD} --rm db createdb -h db -U ${POSTGRES_USER} ${POSTGRES_DB}
docker compose up -d
- name: Cypress run
uses: cypress-io/github-action@v6
with:
record: true
parallel: true
wait-on: 'http://localhost/front/'
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}