-
-
Notifications
You must be signed in to change notification settings - Fork 497
144 lines (126 loc) · 5.23 KB
/
python-package.yml
File metadata and controls
144 lines (126 loc) · 5.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: CI_TEST
on:
push:
pull_request:
branches: [master]
workflow_dispatch: # allow manual run
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.13"]
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
# azure.archive.ubuntu.com:80 - Ubuntu apt packages
# esm.ubuntu.com:443 - Ubuntu ESM security updates
# files.pythonhosted.org:443 - Python package downloads
# ftp-chi.osuosl.org:443 - Python mirror fallback (Chicago)
# ftp-nyc.osuosl.org:443 - Python mirror fallback (NYC)
# github.com:443 - Git operations / Actions
# api.github.com:443 - GitHub API
# int.api.stepsecurity.io:443 - harden-runner telemetry
# mirror.xmission.com:443 - Python mirror fallback (Utah)
# motd.ubuntu.com:443 - Ubuntu MOTD
# packages.microsoft.com:443 - Microsoft apt repo (ubuntu-latest runner)
# ppa.launchpadcontent.net:443 - Ubuntu PPA
# pypi.org:443 - PyPI package index
# objects.githubusercontent.com:443 - GitHub release artifacts / LFS
allowed-endpoints: >
azure.archive.ubuntu.com:80
esm.ubuntu.com:443
files.pythonhosted.org:443
ftp-chi.osuosl.org:443
ftp-nyc.osuosl.org:443
github.com:443
api.github.com:443
int.api.stepsecurity.io:443
mirror.xmission.com:443
motd.ubuntu.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
pypi.org:443
objects.githubusercontent.com:443
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
python-version: ${{ matrix.python-version }}
- name: Install python
run: uv python install
- name: Install dependencies
run: |
sudo apt-get update; sudo apt-get install libkrb5-dev gcc
- name: Lint with ruff
run: |
uv run ruff check jenkinsapi/ --output-format full
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
# azure.archive.ubuntu.com:80 - Ubuntu apt packages
# esm.ubuntu.com:443 - Ubuntu ESM security updates
# files.pythonhosted.org:443 - Python package downloads
# ftp-chi.osuosl.org:443 - Python mirror fallback (Chicago)
# ftp-nyc.osuosl.org:443 - Python mirror fallback (NYC)
# github.com:443 - Git operations / Actions
# api.github.com:443 - GitHub API
# int.api.stepsecurity.io:443 - harden-runner telemetry
# mirror.xmission.com:443 - Python mirror fallback (Utah)
# motd.ubuntu.com:443 - Ubuntu MOTD
# packages.microsoft.com:443 - Microsoft apt repo (ubuntu-latest runner)
# ppa.launchpadcontent.net:443 - Ubuntu PPA
# pypi.org:443 - PyPI package index
# objects.githubusercontent.com:443 - GitHub release artifacts / LFS
allowed-endpoints: >
azure.archive.ubuntu.com:80
esm.ubuntu.com:443
files.pythonhosted.org:443
ftp-chi.osuosl.org:443
ftp-nyc.osuosl.org:443
github.com:443
api.github.com:443
int.api.stepsecurity.io:443
mirror.xmission.com:443
motd.ubuntu.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
pypi.org:443
objects.githubusercontent.com:443
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
python-version: ${{ matrix.python-version }}
- name: Install python
run: uv python install
- name: Install dependencies
run: |
sudo apt-get update; sudo apt-get install libkrb5-dev gcc
- name: Prepare Docker image
uses: ./.github/actions/docker-image-prep
with:
image_name: ghcr.io/${{ github.repository_owner }}/jenkinsapi
- name: Test with pytest
run: |
NUM_WORKERS=auto
echo "Running full test suite with xdist mode '$NUM_WORKERS' ($(nproc) CPUs available)"
uv run pytest -sv -n $NUM_WORKERS --cov=jenkinsapi --cov-report=term-missing --cov-report=xml jenkinsapi_tests