Skip to content

Commit 54cb1c6

Browse files
Merge branch 'main' into 3.8.0.2
2 parents ff8ecd9 + 3a630c5 commit 54cb1c6

40 files changed

+921
-530
lines changed

.config/dictionary.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CAs
2+
assertIn

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @pycontribs/jira
2+
/.github/ @ssbarnea

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ body:
5050
attributes:
5151
label: Python Interpreter version
5252
description: The version(s) of Python used.
53-
placeholder: "3.8"
53+
placeholder: "3.9"
5454
validations:
5555
required: true
5656
- type: checkboxes

.github/release-drafter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# see https://github.com/ansible-community/devtools
2-
_extends: ansible-community/devtools
1+
# see https://github.com/ansible/team-devtools
2+
_extends: ansible/team-devtools

.github/workflows/ack.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.yml
1+
# See https://github.com/ansible/team-devtools/blob/main/.github/workflows/ack.yml
22
name: ack
33
on:
44
pull_request_target:
55
types: [opened, labeled, unlabeled, synchronize]
66

77
jobs:
88
ack:
9-
uses: ansible-community/devtools/.github/workflows/ack.yml@main
9+
uses: ansible/team-devtools/.github/workflows/ack.yml@main

.github/workflows/jira_ci.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
name: ci
22

3+
# runs only after tox workflow finished successfully
34
on:
4-
# Trigger the workflow on push or pull request,
5-
# but only for the main branch
6-
push:
7-
branches:
8-
- main
9-
pull_request:
10-
branches:
11-
- main
5+
workflow_run:
6+
workflows: [tox]
7+
branches: [main]
8+
types:
9+
- completed
1210

1311
jobs:
1412
server:
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1514
uses: pycontribs/jira/.github/workflows/jira_server_ci.yml@main
1615

1716
cloud:

.github/workflows/jira_cloud_ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
os: [ubuntu-latest]
2424
# We only test a single version to prevent concurrent
2525
# running of tests influencing one another
26-
python-version: ["3.8"]
26+
python-version: ["3.9"]
2727

2828
steps:
2929
- uses: actions/checkout@v4
@@ -41,7 +41,7 @@ jobs:
4141
python -m pip install --upgrade tox tox-gh-actions
4242
4343
- name: Test with tox
44-
run: tox -e py38 -- -m allow_on_cloud
44+
run: tox -e py39 -- -m allow_on_cloud
4545
env:
4646
CI_JIRA_TYPE: CLOUD
4747
CI_JIRA_CLOUD_ADMIN: ${{ secrets.CLOUD_ADMIN }}
@@ -50,7 +50,7 @@ jobs:
5050
CI_JIRA_CLOUD_USER_TOKEN: ${{ secrets.CLOUD_USER_TOKEN }}
5151

5252
- name: Upload coverage to Codecov
53-
uses: codecov/codecov-action@v3.1.4
53+
uses: codecov/codecov-action@v4.1.0
5454
with:
5555
file: ./coverage.xml
5656
name: ${{ runner.os }}-${{ matrix.python-version }}-Cloud

.github/workflows/jira_server_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
os: [ubuntu-latest]
14-
python-version: ["3.8", "3.9", "3.10", "3.11"]
14+
python-version: ["3.9", "3.10", "3.11"]
1515
jira-version: [8.17.1]
1616

1717
steps:
@@ -39,7 +39,7 @@ jobs:
3939
run: tox
4040

4141
- name: Upload coverage to Codecov
42-
uses: codecov/codecov-action@v3.1.4
42+
uses: codecov/codecov-action@v4.1.0
4343
with:
4444
file: ./coverage.xml
4545
name: ${{ runner.os }}-${{ matrix.python-version }}

.github/workflows/push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/push.yml
1+
# See https://github.com/ansible/team-devtools/blob/main/.github/workflows/push.yml
22
name: push
33
on:
44
push:
@@ -9,4 +9,4 @@ on:
99

1010
jobs:
1111
ack:
12-
uses: ansible-community/devtools/.github/workflows/push.yml@main
12+
uses: ansible/team-devtools/.github/workflows/push.yml@main

.github/workflows/release.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ jobs:
1313
env:
1414
FORCE_COLOR: 1
1515
PY_COLORS: 1
16-
TOXENV: packaging
16+
TOXENV: pkg
1717
TOX_PARALLEL_NO_SPINNER: 1
1818

1919
steps:
20-
- name: Switch to using Python 3.8 by default
20+
- name: Switch to using Python 3.9 by default
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: 3.8
23+
python-version: 3.9
24+
25+
- name: Install system dependencies
26+
run: |
27+
sudo apt remove -y docker-compose
28+
sudo apt-get update -y
29+
sudo apt-get --assume-yes --no-install-recommends install -y apt-transport-https curl libkrb5-dev
2430
2531
- name: Install build dependencies
2632
run: python3 -m pip install --user tox
@@ -36,14 +42,15 @@ jobs:
3642
- name: Publish to test.pypi.org
3743
if: >- # "create" workflows run separately from "push" & "pull_request"
3844
github.event_name == 'release'
39-
uses: pypa/gh-action-pypi-publish@master
45+
uses: pypa/gh-action-pypi-publish@release/v1
4046
with:
47+
verbose: true
4148
password: ${{ secrets.testpypi_password }}
42-
repository_url: https://test.pypi.org/legacy/
49+
repository-url: https://test.pypi.org/legacy/
4350

4451
- name: Publish to pypi.org
4552
if: >- # "create" workflows run separately from "push" & "pull_request"
4653
github.event_name == 'release'
47-
uses: pypa/gh-action-pypi-publish@master
54+
uses: pypa/gh-action-pypi-publish@release/v1
4855
with:
4956
password: ${{ secrets.pypi_password }}

.github/workflows/tox.yml

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
---
2+
name: tox
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
11+
cancel-in-progress: true
12+
13+
env:
14+
FORCE_COLOR: 1 # tox, pytest
15+
PY_COLORS: 1
16+
17+
jobs:
18+
prepare:
19+
name: prepare
20+
runs-on: ubuntu-24.04
21+
outputs:
22+
matrix: ${{ steps.generate_matrix.outputs.matrix }}
23+
steps:
24+
- name: Determine matrix
25+
id: generate_matrix
26+
uses: coactions/dynamic-matrix@v3
27+
with:
28+
min_python: "3.9"
29+
max_python: "3.12"
30+
default_python: "3.9"
31+
other_names: |
32+
lint
33+
docs
34+
pkg
35+
py39:tox -e py39 --notest
36+
py310:tox -e py310 --notest
37+
py311:tox -e py311 --notest
38+
py312:tox -e py312 --notest
39+
py39-macos:tox -e py312 --notest
40+
py312-macos:tox -e py312 --notest
41+
# ^ macos is also used to validate arm64 building
42+
platforms: linux,macos
43+
skip_explode: "1"
44+
build:
45+
name: ${{ matrix.name }}
46+
runs-on: ${{ matrix.os || 'ubuntu-24.04' }}
47+
needs:
48+
- prepare
49+
strategy:
50+
fail-fast: false
51+
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
52+
steps:
53+
54+
- name: Install package dependencies (ubuntu)
55+
if: ${{ contains(matrix.os, 'ubuntu') }}
56+
run: |
57+
sudo apt remove -y docker-compose
58+
sudo apt-get update -y
59+
sudo apt-get --assume-yes --no-install-recommends install -y apt-transport-https curl libkrb5-dev
60+
61+
- uses: actions/checkout@v4
62+
with:
63+
fetch-depth: 0 # needed by setuptools-scm
64+
submodules: true
65+
66+
- name: Set pre-commit cache
67+
uses: actions/cache@v4
68+
if: ${{ contains(matrix.name, 'lint') }}
69+
with:
70+
path: |
71+
~/.cache/pre-commit
72+
key: pre-commit-${{ matrix.name }}-${{ hashFiles('.pre-commit-config.yaml') }}
73+
74+
- name: Set up Python ${{ matrix.python_version || '3.10' }}
75+
uses: actions/setup-python@v5
76+
with:
77+
cache: pip
78+
python-version: ${{ matrix.python_version || '3.10' }}
79+
cache-dependency-path: "*requirements*.txt"
80+
81+
- name: Install tox
82+
run: |
83+
python3 -m pip install --upgrade pip wheel tox
84+
85+
- run: ${{ matrix.command }}
86+
87+
- run: ${{ matrix.command2 }}
88+
if: ${{ matrix.command2 }}
89+
90+
- run: ${{ matrix.command3 }}
91+
if: ${{ matrix.command3 }}
92+
93+
- run: ${{ matrix.command4 }}
94+
if: ${{ matrix.command4 }}
95+
96+
- run: ${{ matrix.command5 }}
97+
if: ${{ matrix.command5 }}
98+
99+
- name: Archive logs
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: logs-${{ matrix.name }}.zip
103+
if-no-files-found: error
104+
include-hidden-files: true
105+
path: |
106+
.tox/**/log/
107+
.tox/**/coverage.xml
108+
109+
- name: Report failure if git reports dirty status
110+
run: |
111+
if [[ -n $(git status -s) ]]; then
112+
# shellcheck disable=SC2016
113+
echo -n '::error file=git-status::'
114+
printf '### Failed as git reported modified and/or untracked files\n```\n%s\n```\n' "$(git status -s)" | tee -a "$GITHUB_STEP_SUMMARY"
115+
exit 99
116+
fi
117+
# https://github.com/actions/toolkit/issues/193
118+
check:
119+
if: always()
120+
environment: check
121+
permissions:
122+
id-token: write
123+
checks: read
124+
125+
needs:
126+
- build
127+
128+
runs-on: ubuntu-24.04
129+
130+
steps:
131+
# checkout needed for codecov action which needs codecov.yml file
132+
- uses: actions/checkout@v4
133+
134+
- name: Set up Python # likely needed for coverage
135+
uses: actions/setup-python@v5
136+
with:
137+
python-version: "3.12"
138+
139+
- run: pip3 install 'coverage>=7.5.1'
140+
141+
- name: Merge logs into a single archive
142+
uses: actions/upload-artifact/merge@v4
143+
with:
144+
name: logs.zip
145+
pattern: logs-*.zip
146+
# artifacts like py312.zip and py312-macos do have overlapping files
147+
separate-directories: true
148+
149+
- name: Download artifacts
150+
uses: actions/download-artifact@v4
151+
with:
152+
name: logs.zip
153+
path: .
154+
155+
- name: Check for expected number of coverage.xml reports
156+
run: |
157+
JOBS_PRODUCING_COVERAGE=0
158+
if [ "$(find . -name coverage.xml | wc -l | bc)" -ne "${JOBS_PRODUCING_COVERAGE}" ]; then
159+
echo "::error::Number of coverage.xml files was not the expected one (${JOBS_PRODUCING_COVERAGE}): $(find . -name coverage.xml |xargs echo)"
160+
exit 1
161+
fi
162+
163+
# Single uploads inside check job for codecov to allow use to retry
164+
# it when it fails without running tests again. Fails often enough!
165+
- name: Upload junit xml reports
166+
# PRs from forks might not have access to the secret
167+
if: env.CODECOV_TOKEN
168+
env:
169+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN || env.CODECOV_TOKEN }}
170+
uses: codecov/test-results-action@v1
171+
with:
172+
name: ${{ matrix.name }}
173+
files: "*/tests/output/junit/*.xml"
174+
fail_ci_if_error: true
175+
token: ${{ secrets.CODECOV_TOKEN }}
176+
177+
- name: Upload coverage data
178+
uses: codecov/codecov-action@v4
179+
with:
180+
name: ${{ matrix.name }}
181+
# verbose: true # optional (default = false)
182+
fail_ci_if_error: false
183+
use_oidc: true # cspell:ignore oidc
184+
files: "*/tests/output/reports/coverage.xml"
185+
186+
# - name: Check codecov.io status
187+
# if: github.event_name == 'pull_request'
188+
# uses: coactions/codecov-status@main
189+
190+
- name: Decide whether the needed jobs succeeded or failed
191+
uses: re-actors/alls-green@release/v1
192+
with:
193+
jobs: ${{ toJSON(needs) }}
194+
195+
- name: Delete Merged Artifacts
196+
uses: actions/upload-artifact/merge@v4
197+
with:
198+
delete-merged: true

0 commit comments

Comments
 (0)