-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 1.6 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
name: ci
on: push
jobs:
test:
environment: development
runs-on: ubuntu-22.04
container: tyknkd/spark:3.3.2-scala2.13-jdk17-gradle8.7-jammy
env:
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
NEWS_API_KEY: ${{ secrets.NEWS_API_KEY }}
POSTGRES_USER: newsanalyzer
POSTGRES_DB: collector_db
POSTGRES_HOST: db
OS_ENV: container
services:
db:
image: postgres:16.2
env:
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
mq:
image: rabbitmq:3.13-management
ports:
- 5672:5672
- 15692:15692
options: >-
--health-cmd "rabbitmq-diagnostics check_port_connectivity"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Install PostgreSQL client
run: |
apt update
apt install -y postgresql-client
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize databases
shell: bash
run: |
source .env
chmod +x ./docker-databases/docker-entrypoint-initdb.d/init-additional-db.sh
./docker-databases/docker-entrypoint-initdb.d/init-additional-db.sh
- name: Run tests
shell: bash
run: |
source .env
gradle test