This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
75 lines (71 loc) · 1.92 KB
/
test-backoffice.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
name: Tests
on:
workflow_call:
inputs:
ref:
description: The reference to build
type: string
required: true
outputs:
image-id:
description: The ID of image that has been built
value: ${{ jobs.build.outputs.image-id }}
jobs:
build:
uses: ./.github/workflows/build.yml
with:
ref: ${{ inputs.ref }}
image: cern-sis/inspire/backoffice
context: ./backoffice
dockerfile: ./backoffice/Dockerfile
secrets: inherit
test:
needs: build
runs-on: ubuntu-latest
services:
opensearch:
image: registry.cern.ch/cern-sis/inspirehep/opensearch
env:
bootstrap.memory_lock: true
ES_JAVA_OPTS: -Xms1024m -Xmx1024m
discovery.type: single-node
DISABLE_SECURITY_PLUGIN: true
ports:
- 9200:9200
rabbitmq:
image: rabbitmq:3-management
ports:
- 5672:5672
redis:
image: redis:6
ports:
- 6379:6379
db:
image: postgres:14.1
env:
POSTGRES_DB: inspire
POSTGRES_USER: inspire
POSTGRES_PASSWORD: inspire
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Test
working-directory: ./backoffice
run: >
docker run
--pull always
--network=host
--entrypoint poetry
--env DJANGO_SETTINGS_MODULE=config.settings.test
--env DISABLE_SECURITY_PLUGIN=true
--env POSTGRES_DB=inspire
--env POSTGRES_USER=inspire
--env POSTGRES_PASSWORD=inspire
--env POSTGRES_HOST=127.0.0.1
--env OPENSEARCH_HOST=127.0.0.1:9200
registry.cern.ch/cern-sis/inspire/backoffice@${{ needs.build.outputs.image-id }}
run pytest