Skip to content

Fix release.yml, redefinition of top-level "env" (#644) #3773

Fix release.yml, redefinition of top-level "env" (#644)

Fix release.yml, redefinition of top-level "env" (#644) #3773

Workflow file for this run

---
name: CI
on:
pull_request:
push:
jobs:
tox:
name: django-ansible-base - ${{ matrix.tests.env }}
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
fail-fast: false
matrix:
tests:
- env: check
python-version: "3.11"
sonar: false
junit-xml-upload: false
- env: py39
python-version: "3.9"
sonar: false
junit-xml-upload: false
- env: py310
python-version: "3.10"
sonar: false
junit-xml-upload: false
- env: py311
python-version: "3.11"
sonar: true
junit-xml-upload: true
- env: py311sqlite
python-version: "3.11"
sonar: false
junit-xml-upload: false
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Install build requirements
run: sudo apt-get update && sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev libxmlsec1-dev
- name: Install python ${{ matrix.tests.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.tests.python-version }}
- name: Install tox
run: pip${{ matrix.tests.python-version }} install tox tox-docker
- name: Run tox
run: |
echo "::remove-matcher owner=python::" # Disable annoying annotations from setup-python
tox -e ${{ matrix.tests.env }}
- name: Inject PR number into coverage.xml
if: matrix.tests.sonar
run: sed -i '2i <!-- PR ${{ github.event.number }} -->' coverage.xml
- name: Upload coverage as artifact
uses: actions/upload-artifact@v4
if: matrix.tests.sonar
with:
name: coverage
path: coverage.xml
- name: SonarCloud Scan (on push)
uses: SonarSource/sonarcloud-github-action@master
if: matrix.tests.sonar && github.event_name == 'push' && github.repository == 'ansible/django-ansible-base'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Upload jUnit XML test results
if: matrix.tests.junit-xml-upload && github.event_name == 'push' && github.repository == 'ansible/django-ansible-base' && github.ref_name == 'devel'
continue-on-error: true
run: >-
curl -v --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}"
--form "[email protected]"
--form "component_name=django-ansible-base"
--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/"