-
Notifications
You must be signed in to change notification settings - Fork 47
153 lines (136 loc) · 4.91 KB
/
e2e-dispatch.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
145
146
147
148
149
150
151
152
153
name: e2e tests on demand
on:
workflow_dispatch:
inputs:
edaqa_ref:
description: 'ref of the eda-qa repository, default is main'
required: false
default: 'main'
pytest_filter:
description: 'filter for pytest to be used after "-k" flag, default is empty'
required: false
default: ''
pull_request_target:
types:
- labeled
- synchronize
env:
EDA_QA_PATH: "./eda-qa"
REGISTRY: quay.io
QUAY_USER: ansible+eda_gha
jobs:
api-e2e-tests:
if: >
(github.repository == 'ansible/eda-server' && github.event_name == 'workflow_dispatch') ||
(github.repository == 'ansible/eda-server' && github.event_name == 'pull_request_target' &&
contains(github.event.pull_request.labels.*.name, 'run-e2e'))
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name || github.repository }}
ref: >-
${{
github.event_name == 'pull_request_target' && github.event.pull_request.head.ref
|| github.sha
}}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Run api in background
working-directory: .
env:
DJANGO_SETTINGS_MODULE: aap_eda.settings.default
EDA_DEBUG: "false"
run: |
docker compose -p eda -f tools/docker/docker-compose-dev.yaml build
docker compose -p eda -f tools/docker/docker-compose-dev.yaml up -d
while ! curl -s http://localhost:8000/_healthz | grep -q "OK"; do
echo "Waiting for API to be ready..."
sleep 1
done
- name: Fetch test suite
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: ansible/eda-qa
ref: ${{ github.event.inputs.edaqa_ref }}
path: ${{ env.EDA_QA_PATH }}
token: ${{ secrets.EDA_QA_GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
working-directory: ${{ env.EDA_QA_PATH }}
run: pip install .
- name: Run tests
working-directory: ${{ env.EDA_QA_PATH }}
env:
EDAQA_FERNET_PASSWORD: ${{ secrets.EDAQA_FERNET_PASSWORD }}
EDAQA_ENV: authenticated
EDAQA_MAX_CONCURRENT_ACTIVATIONS: 10
run: |
if [ -n "${{ github.event.inputs.pytest_filter }}" ]; then
pytest -vv -k "${{ github.event.inputs.pytest_filter }}"
else
pytest -vv
fi
- name: Print EDA logs
if: always()
working-directory: tools/docker
run: |
docker compose -p eda -f docker-compose-dev.yaml logs
api-e2e-multinode-tests:
if: >
(github.repository == 'ansible/eda-server' && github.event_name == 'workflow_dispatch') ||
(github.repository == 'ansible/eda-server' && github.event_name == 'pull_request_target' &&
contains(github.event.pull_request.labels.*.name, 'run-e2e'))
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name || github.repository }}
ref: >-
${{
github.event_name == 'pull_request_target' && github.event.pull_request.head.ref
|| github.sha
}}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Fetch test suite
uses: actions/checkout@v3
with:
fetch-depth: 0
repository: ansible/eda-qa
ref: ${{ github.event.inputs.edaqa_ref }}
path: ${{ env.EDA_QA_PATH }}
token: ${{ secrets.EDA_QA_GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
working-directory: ${{ env.EDA_QA_PATH }}
run: pip install .
- name: Build eda-server images
working-directory: .
run: |
docker compose -p eda-multinode -f tools/docker/docker-compose-dev.yaml build
- name: Run multinode tests
working-directory: ${{ env.EDA_QA_PATH }}
env:
EDAQA_FERNET_PASSWORD: ${{ secrets.EDAQA_FERNET_PASSWORD }}
EDAQA_ENV: default
EDAQA_MULTINODE_EDA_SERVER_PATH: "../"
run: |
pytest -vv -s eda_qa/tests/multinode-upstream