21
21
- name : Checkout
22
22
uses : actions/checkout@v3
23
23
24
- - name : Install poetry
25
- run : pipx install poetry
26
-
27
- - name : Set up Python
28
- uses : actions/setup-python@v5
29
- with :
30
- python-version : ' 3.11'
31
- cache : ' poetry'
32
-
33
- - name : Install dependencies
34
- run : poetry install --no-root --only=lint
35
-
36
- - name : Lint with black
37
- run : poetry run black --check .
38
-
39
- - name : Lint with isort
40
- run : poetry run isort --check .
41
-
42
- - name : Lint with ruff
43
- run : poetry run ruff check .
44
-
45
- - name : Lint with flake8
46
- run : poetry run flake8 . --count --show-source --statistics
47
-
24
+ - name : lint
25
+ uses : ./.github/actions/lint
48
26
49
27
test :
50
28
runs-on : ubuntu-latest
@@ -56,13 +34,16 @@ jobs:
56
34
env :
57
35
EDA_SECRET_KEY : ' test'
58
36
EDA_DB_PASSWORD : ' secret'
37
+ PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER : ${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}
38
+ PDE_ORG_RESULTS_UPLOAD_PASSWORD : ${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}
39
+ PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL : ${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}
59
40
services :
60
41
postgres :
61
42
image : ' quay.io/sclorg/postgresql-15-c9s:latest'
62
43
env :
63
44
POSTGRESQL_USER : eda
64
- POSTGRESQL_PASSWORD : secret
65
- POSTGRESQL_ADMIN_PASSWORD : secret
45
+ POSTGRESQL_PASSWORD : ${{ env.EDA_DB_PASSWORD }}
46
+ POSTGRESQL_ADMIN_PASSWORD : ${{ env.EDA_DB_PASSWORD }}
66
47
POSTGRESQL_DATABASE : eda
67
48
options : >-
68
49
--health-cmd pg_isready
84
65
- name : Checkout
85
66
uses : actions/checkout@v3
86
67
87
- - name : Install poetry
88
- run : pipx install poetry
89
-
90
- - name : Set up Python
91
- uses : actions/setup-python@v5
68
+ - name : test
69
+ uses : ./.github/actions/test
92
70
with :
93
- python-version : ${{ matrix.python-version }}
94
- cache : ' poetry'
95
-
96
- - name : Install package
97
- run : poetry install -E all --only main,test
98
-
99
- - name : Check migrations are up to date
100
- run : poetry run /usr/bin/env aap-eda-manage makemigrations --dry-run --check
101
-
102
- - name : Run default tests
103
- run : |
104
- poetry run python -m pytest -vv \
105
- --cov=./ \
106
- --cov-report=xml \
107
- --junit-xml=eda-server-default.xml
108
- echo "GIT_SHA=$(git rev-parse "$GITHUB_SHA")" >> "$GITHUB_ENV"
109
-
110
- - name : Run multithreaded tests
111
- run : |
112
- poetry run python -m pytest -vv \
113
- --cov=./ \
114
- --cov-append \
115
- --junit-xml=eda-server-multithreaded.xml \
116
- -m "multithreaded"
117
-
118
- - name : Merge test results
119
- run : |
120
- pip install junitparser
121
- junitparser merge eda-server-default.xml eda-server-multithreaded.xml eda-server-test-results.xml
122
-
123
- - name : Upload coverage to Codecov
124
- uses : codecov/codecov-action@v5
125
- with :
126
- env_vars : OS,PYTHON
127
- fail_ci_if_error : false
128
- files : ./coverage.xml
129
- flags : " unit-int-tests-${{ matrix.python-version }}"
130
- name : codecov-umbrella
131
- verbose : true
132
-
133
- - name : Upload jUnit test results (APDE CI)
134
- if : github.repository == 'ansible/eda-server' && github.ref == 'refs/heads/main'
135
- run : >-
136
- poetry run http --check-status --ignore-stdin
137
- --auth "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}"
138
- -f POST "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/"
139
-
140
- component_name=eda
141
- git_commit_sha=${{ env.GIT_SHA }}
142
- git_repository_url="https://github.com/${{ github.repository }}"
71
+ python-version : ${{ matrix.python-version }}
0 commit comments