Skip to content

Commit e59aa23

Browse files
authored
[stable-4.9] Adding tox (#2481)
Issue: AAP-41516 Signed-off-by: Fabricio Aguiar <[email protected]> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
1 parent f585bf4 commit e59aa23

File tree

11 files changed

+523
-24
lines changed

11 files changed

+523
-24
lines changed

.github/workflows/ci_full.yml

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
name: galaxy_ng/ci
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
9+
lint_po:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
ref: ${{ github.event.after }} # for PR avoids checking out merge commit
17+
fetch-depth: 0 # include all history
18+
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.11"
22+
23+
- name: install and run lint-po
24+
run: |
25+
pip3 install lint-po
26+
lint-po ./galaxy_ng/locale/*/LC_MESSAGES/*.po
27+
28+
lint:
29+
runs-on: ubuntu-latest
30+
steps:
31+
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
with:
35+
ref: ${{ github.event.after }} # for PR avoids checking out merge commit
36+
fetch-depth: 0 # include all history
37+
38+
- uses: actions/setup-python@v4
39+
with:
40+
python-version: "3.11"
41+
42+
- name: Install requirements
43+
run: pip3 install -r lint_requirements.txt
44+
45+
- name: Run linters
46+
run: make lint
47+
48+
- name: Check for pulpcore imports outside of pulpcore.plugin
49+
run: sh .ci/scripts/check_pulpcore_imports.sh
50+
51+
- name: Check for gettext problems
52+
run: sh .ci/scripts/check_gettext.sh
53+
54+
test:
55+
runs-on: ubuntu-latest
56+
steps:
57+
58+
- uses: actions/setup-python@v4
59+
with:
60+
python-version: "3.11"
61+
62+
- uses: actions/checkout@v4
63+
with:
64+
fetch-depth: 0
65+
66+
- name: checkout dab
67+
run: |
68+
cd ..
69+
git clone https://github.com/ansible/django-ansible-base
70+
71+
- name: install system dependencies
72+
run: |
73+
sudo apt update
74+
sudo apt install -y libsasl2-dev libldap2-dev libssl-dev gettext
75+
76+
- name: install tox & coverage
77+
run: pip3 install tox coverage[toml]
78+
79+
- name: run the unit tests
80+
run: tox --colored yes -e py311
81+
env:
82+
PY_COLORS: 1
83+
84+
- name: Inject PR number into coverage.xml
85+
run: sed -i '2i <!-- PR ${{ github.event.number }} -->' coverage.xml
86+
87+
- name: upload coverage as artifact
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: coverage
91+
path: coverage.xml
92+
93+
- name: SonarCloud Scan
94+
uses: SonarSource/sonarcloud-github-action@master
95+
if: github.event_name == 'push' && github.repository == 'ansible/galaxy_ng' && github.ref_name == 'master'
96+
env:
97+
SONAR_TOKEN: ${{ secrets.CICD_ORG_SONAR_TOKEN_CICD_BOT }}
98+
99+
- name: upload jUnit XML test results
100+
if: github.event_name == 'push' && github.repository == 'ansible/galaxy_ng' && github.ref_name == 'master'
101+
continue-on-error: true
102+
run: |
103+
curl -v --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}" \
104+
--form "xunit_xml=@/tmp/galaxy_ng-test-results.xml" \
105+
--form "component_name=hub" \
106+
--form "git_commit_sha=${{ github.sha }}" \
107+
--form "git_repository_url=https://github.com/${{ github.repository }}" \
108+
"${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/"

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ exclude netlify.toml
1515
exclude docs
1616
exclude docs_requirements.txt
1717
exclude .readthedocs.yaml
18+
exclude tox.ini
1819
include django-automated-logging-LICENSE.txt
1920
include galaxy_ng/automated_logging/templates/dal/admin/view.html
2021
recursive-include galaxy_ng *.py

0 commit comments

Comments
 (0)