Skip to content

Commit 8a64dcc

Browse files
authored
Refactor CI pipeline configuration for 1ESPR template build
1 parent cb1d79e commit 8a64dcc

1 file changed

Lines changed: 61 additions & 46 deletions

File tree

.azdo/ci-pr.yaml

Lines changed: 61 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,67 @@ pr:
66

77
trigger: none # Only run on PRs, not on direct pushes
88

9-
pool:
10-
vmImage: ubuntu-latest
9+
resources:
10+
repositories:
11+
- repository: 1ESPipelineTemplates
12+
type: git
13+
name: 1ESPipelineTemplates/1ESPipelineTemplates
14+
ref: refs/tags/release
15+
extends:
16+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
17+
parameters:
18+
pool:
19+
name: Azure-Pipelines-1ESPT-ExDShared
20+
image: ubuntu-latest
21+
os: linux
1122

23+
stages:
24+
- stage: stage
25+
jobs:
26+
- job: PythonBuild
1227
# Simplified to single Python version (per project requirements)
1328
# Can expand to matrix testing later if needed
14-
15-
steps:
16-
- task: UsePythonVersion@0
17-
inputs:
18-
versionSpec: '3.12'
19-
addToPath: true
20-
displayName: 'Use Python 3.12'
21-
22-
- script: |
23-
python -m pip install --upgrade pip
24-
python -m pip install flake8 black build
25-
if [ -f dev_dependencies.txt ]; then pip install -r dev_dependencies.txt; fi
26-
displayName: 'Install dependencies'
27-
28-
- script: |
29-
black src tests --check
30-
displayName: 'Check format with black'
31-
continueOnError: true # TODO: fix detected formatting errors and remove this line
32-
33-
- script: |
34-
# stop the build if there are Python syntax errors or undefined names
35-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36-
# exit-zero treats all errors as warnings
37-
flake8 . --count --exit-zero --show-source --statistics
38-
displayName: 'Lint with flake8'
39-
40-
- script: |
41-
python -m build
42-
displayName: 'Build package'
43-
44-
- script: |
45-
python -m pip install dist/*.whl
46-
displayName: 'Install wheel'
47-
48-
- script: |
49-
pytest
50-
displayName: 'Test with pytest'
51-
52-
- task: PublishTestResults@2
53-
condition: succeededOrFailed()
54-
inputs:
55-
testResultsFiles: '**/test-*.xml'
56-
testRunTitle: 'Python 3.12'
57-
displayName: 'Publish test results'
29+
30+
steps:
31+
- task: UsePythonVersion@0
32+
inputs:
33+
versionSpec: '3.12'
34+
addToPath: true
35+
displayName: 'Use Python 3.12'
36+
37+
- script: |
38+
python -m pip install --upgrade pip
39+
python -m pip install flake8 black build
40+
if [ -f dev_dependencies.txt ]; then pip install -r dev_dependencies.txt; fi
41+
displayName: 'Install dependencies'
42+
43+
- script: |
44+
black src tests --check
45+
displayName: 'Check format with black'
46+
continueOnError: true # TODO: fix detected formatting errors and remove this line
47+
48+
- script: |
49+
# stop the build if there are Python syntax errors or undefined names
50+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
51+
# exit-zero treats all errors as warnings
52+
flake8 . --count --exit-zero --show-source --statistics
53+
displayName: 'Lint with flake8'
54+
55+
- script: |
56+
python -m build
57+
displayName: 'Build package'
58+
59+
- script: |
60+
python -m pip install dist/*.whl
61+
displayName: 'Install wheel'
62+
63+
- script: |
64+
pytest
65+
displayName: 'Test with pytest'
66+
67+
- task: PublishTestResults@2
68+
condition: succeededOrFailed()
69+
inputs:
70+
testResultsFiles: '**/test-*.xml'
71+
testRunTitle: 'Python 3.12'
72+
displayName: 'Publish test results'

0 commit comments

Comments
 (0)