-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (135 loc) · 4.57 KB
/
robotframeworkci.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Robot Framework tests
on:
pull_request:
branches: [ main ]
jobs:
composer-install:
runs-on: ubuntu-22.04
strategy:
max-parallel: 3
matrix:
php-versions: [ '8.1' ]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: vendor/
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
extensions: zip
- name: Install Dependencies
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.REPO_READ_ONLY_TOKEN }}"}}'
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
robot-tests:
needs:
- composer-install
runs-on: ubuntu-22.04
strategy:
max-parallel: 3
matrix:
php-versions: [ '8.1' ]
services:
postgres:
image: postgres:12.5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:latest
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
rabbitmq:
image: rabbitmq:3.9.7-management
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672:5672
- 15672:15672
options: --health-cmd "rabbitmq-diagnostics -q check_running" --health-interval 10s --health-timeout 5s --health-retries 5
tika:
image: apache/tika:latest
ports:
- 9998:9998
elasticsearch:
image: elasticsearch:8.2.2
env:
discovery.type: single-node
cluster.name: elasticsearch
bootstrap.memory_lock: "true"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
xpack.security.enabled: false
ports:
- 9200:9200
- 9300:9300
options: --health-cmd "curl -f http://localhost:9200/_cluster/health?wait_for_status=yellow" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
extensions: xdebug, pgsql
- uses: actions/cache@v3
with:
path: vendor/
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Copy .env
run: cp -n .env.ci .env.local
- name: Execute Generate Database Key
run: |
DBKEY=$(bin/console generate:database-key)
echo DATABASE_ENCRYPTION_KEY=${DBKEY:5} >> .env.local
cat .env.local
- name: Build FE
run: |
echo "//npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
npm ci
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.REPO_READ_ONLY_TOKEN }}
- name: Download symfony app
run: |
wget https://get.symfony.com/cli/installer -O - | bash
mv /home/runner/.symfony5/bin/symfony /usr/local/bin/symfony
- name: Migrate and seed database
run: php bin/console d:m:m -n && php bin/console d:f:l -n
- name: Run Symfony Server
run: symfony server:start -d
# Robot framework setup
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Robot Framework dependencies
run: |
sudo apt-get install --reinstall libpq-dev
python -m pip install --upgrade pip
pip install -r tests/robot_framework/requirements.txt
rfbrowser init
- name: Execute tests (Robot Framework)
run: |
python -m robot -d tests/robot_framework/results -x outputxunit.xml -i CI -v headless:true tests/robot_framework
- name: Upload RF test results
uses: actions/upload-artifact@v3
if: always()
with:
name: reports
path: tests/robot_framework/results
- name: Publish Robot Framework test results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: ${{ always() && github.actor != 'dependabot[bot]' }}
with:
junit_files: tests/robot_framework/results/outputxunit.xml
check_name: Robot Framework FE tests