2929 artifactory-deployer-role : qa-deployer
3030 deploy-pull-request : true
3131
32-
3332 formatting :
3433 name : " Formatting"
3534 runs-on : github-ubuntu-latest-s
3837 contents : write
3938 steps :
4039 - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
41- - uses : jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # v3.3.1
42- with :
43- install_args : " poetry@2.2.1"
44- - run : mise use -g poetry@2.2.1
45- - uses : SonarSource/ci-github-actions/build-poetry@v1
46- with :
47- sonar-platform : none
48- artifactory-reader-role : private-reader
49- artifactory-deployer-role : qa-deployer
50- - run : poetry install
40+ - uses : ./.github/actions/config-poetry
5141 - run : |
5242 poetry run black src/ tests/ --check
5343 poetry run licenseheaders -t license_header.tmpl -o "SonarSource SA" -y 2011-2024 -n "Sonar Scanner Python" -E .py -d src/
@@ -66,33 +56,52 @@ jobs:
6656 with :
6757 install_args : " poetry@2.2.1"
6858 - run : mise use -g poetry@2.2.1
69- - run : poetry install
7059 - run : |
7160 poetry run python tools/generate_cli_documentation.py
7261 git diff --exit-code CLI_ARGS.md
7362
63+ coverage :
64+ name : " Coverage report generation"
65+ runs-on : github-ubuntu-latest-s
66+ permissions :
67+ id-token : write
68+ contents : write
69+ steps :
70+ - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
71+ - uses : ./.github/actions/config-poetry
72+ - run : |
73+ poetry run pytest --cov-report=xml:coverage.xml --cov-config=pyproject.toml --cov=src --cov-branch tests
74+ poetry run mypy src/ > mypy-report.txt || true
75+ - name : Upload coverage artifacts
76+ uses : actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
77+ with :
78+ name : coverage-reports
79+ path : |
80+ coverage.xml
81+ mypy-report.txt
82+
7483 analysis :
7584 name : " NEXT Analysis"
7685 runs-on : github-ubuntu-latest-s
86+ needs : [coverage]
7787 permissions :
7888 id-token : write
7989 contents : write
8090 steps :
8191 - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
92+ - name : Download coverage artifacts
93+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
94+ with :
95+ name : coverage-reports
8296 - uses : jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # v3.3.1
8397 with :
8498 install_args : " poetry@2.2.1"
85- - run : |
86- mise use -g poetry@2.2.1
99+ - run : mise use -g poetry@2.2.1
87100 - uses : SonarSource/ci-github-actions/build-poetry@v1
88101 with :
89- sonar-platform : next
90- artifactory-reader-role : private-reader
102+ sonar-platform : next
103+ artifactory-reader-role : private-reader
91104 artifactory-deployer-role : qa-deployer
92- - run : poetry install
93- - run : |
94- poetry run pytest --cov-report=xml:coverage.xml --cov-config=pyproject.toml --cov=src --cov-branch tests
95- poetry run mypy src/ > mypy-report.txt || true
96105
97106 qa :
98107 name : " Test Python ${{ matrix.python-version }}"
@@ -105,17 +114,7 @@ jobs:
105114 python-version : ["3.9.18", "3.9.6", "3.10.13", "3.11.7", "3.12.1", "3.13.2"]
106115 steps :
107116 - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
108- - uses : jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # v3.3.1
109- with :
110- install_args : " poetry@2.2.1"
111- - run : mise use -g poetry@2.2.1
112- - uses : SonarSource/ci-github-actions/build-poetry@v1
113- with :
114- sonar-platform : none
115- python-version : ${{ matrix.python-version }}
116- artifactory-reader-role : private-reader
117- artifactory-deployer-role : qa-deployer
118- - run : poetry install
117+ - uses : ./.github/actions/config-poetry
119118 - run : |
120119 poetry run pytest tests/
121120
@@ -127,15 +126,7 @@ jobs:
127126 contents : write
128127 steps :
129128 - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
130- - uses : jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # v3.3.1
131- with :
132- install_args : " poetry@2.2.1"
133- - uses : SonarSource/ci-github-actions/build-poetry@v1
134- with :
135- sonar-platform : none
136- artifactory-reader-role : private-reader
137- artifactory-deployer-role : qa-deployer
138- - run : poetry install
129+ - uses : ./.github/actions/config-poetry
139130 - run : |
140131 poetry run pytest tests/
141132
@@ -148,7 +139,7 @@ jobs:
148139 steps :
149140 - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
150141 - name : Cache SonarQube
151- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
142+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
152143 with :
153144 path : sonarqube_cache/
154145 key : sonarqube-25.3.0.104237
@@ -160,10 +151,8 @@ jobs:
160151 fi
161152 env :
162153 SONARQUBE_VERSION : 25.3.0.104237
163- - uses : SonarSource/ci-github-actions/build-poetry@v1
164- with :
165- sonar-platform : none
166- script : .github/scripts/run_its.sh
154+ - uses : ./.github/actions/config-poetry
155+ - run : ./.github/scripts/run_its.sh
167156
168157 promote :
169158 name : " Promote"
0 commit comments