Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-4.9] Adding tox #2481

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/ci_full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
name: galaxy_ng/ci
on:
- push
- pull_request

jobs:

lint_po:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.after }} # for PR avoids checking out merge commit
fetch-depth: 0 # include all history

- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: install and run lint-po
run: |
pip3 install lint-po
lint-po ./galaxy_ng/locale/*/LC_MESSAGES/*.po

lint:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.after }} # for PR avoids checking out merge commit
fetch-depth: 0 # include all history

- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install requirements
run: pip3 install -r lint_requirements.txt

- name: Run linters
run: make lint

- name: Check for pulpcore imports outside of pulpcore.plugin
run: sh .ci/scripts/check_pulpcore_imports.sh

- name: Check for gettext problems
run: sh .ci/scripts/check_gettext.sh

test:
runs-on: ubuntu-latest
steps:

- uses: actions/setup-python@v4
with:
python-version: "3.11"

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: checkout dab
run: |
cd ..
git clone https://github.com/ansible/django-ansible-base

- name: install system dependencies
run: |
sudo apt update
sudo apt install -y libsasl2-dev libldap2-dev libssl-dev gettext

- name: install tox & coverage
run: pip3 install tox coverage[toml]

- name: run the unit tests
run: tox --colored yes -e py311
env:
PY_COLORS: 1

- name: Inject PR number into coverage.xml
run: sed -i '2i <!-- PR ${{ github.event.number }} -->' coverage.xml

- name: upload coverage as artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.xml

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
if: github.event_name == 'push' && github.repository == 'ansible/galaxy_ng' && github.ref_name == 'master'
env:
SONAR_TOKEN: ${{ secrets.CICD_ORG_SONAR_TOKEN_CICD_BOT }}

- name: upload jUnit XML test results
if: github.event_name == 'push' && github.repository == 'ansible/galaxy_ng' && github.ref_name == 'master'
continue-on-error: true
run: |
curl -v --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}" \
--form "xunit_xml=@/tmp/galaxy_ng-test-results.xml" \
--form "component_name=hub" \
--form "git_commit_sha=${{ github.sha }}" \
--form "git_repository_url=https://github.com/${{ github.repository }}" \
"${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/"
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ exclude netlify.toml
exclude docs
exclude docs_requirements.txt
exclude .readthedocs.yaml
exclude tox.ini
include django-automated-logging-LICENSE.txt
include galaxy_ng/automated_logging/templates/dal/admin/view.html
recursive-include galaxy_ng *.py
Loading