Changed structure of build pipeline yaml

This commit is contained in:
Marek Wolan
2023-07-11 08:53:37 +00:00
parent 81a8058836
commit a303e9096a

View File

@@ -14,75 +14,77 @@ parameters:
- job_name: 'UbuntuPython38' - job_name: 'UbuntuPython38'
py: '3.8' py: '3.8'
img: 'ubuntu-latest' img: 'ubuntu-latest'
only_pr: false every_time: false
- job_name: 'UbuntuPython310' - job_name: 'UbuntuPython310'
py: '3.10' py: '3.10'
img: 'ubuntu-latest' img: 'ubuntu-latest'
only_pr: true every_time: true
- job_name: 'WindowsPython38' - job_name: 'WindowsPython38'
py: '3.8' py: '3.8'
img: 'windows-latest' img: 'windows-latest'
only_pr: false every_time: false
- job_name: 'WindowsPython310' - job_name: 'WindowsPython310'
py: '3.10' py: '3.10'
img: 'windows-latest' img: 'windows-latest'
only_pr: false every_time: false
- job_name: 'MacOSPython38' - job_name: 'MacOSPython38'
py: '3.8' py: '3.8'
img: 'macOS-latest' img: 'macOS-latest'
only_pr: false every_time: false
- job_name: 'MacOSPython310' - job_name: 'MacOSPython310'
py: '3.10' py: '3.10'
img: 'macOS-latest' img: 'macOS-latest'
only_pr: false every_time: false
stages: stages:
- stage: Test - stage: Test
jobs: jobs:
- ${{ each item in parameters.matrix }}: - ${{ each item in parameters.matrix }}:
${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.only_pr) }}: - job: ${{ item.job_name }}
- job: ${{ item.job_name }} pool:
pool: vmImage: ${{ item.img }}
vmImage: ${{ item.img }}
steps: condition: or( eq(variables['BuildReason'], 'PullRequest'), item.every_time )
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ item.py }}
displayName: 'Use Python ${{ item.py }}'
- script: | steps:
python -m pip install pre-commit - task: UsePythonVersion@0
pre-commit install inputs:
pre-commit run --all-files versionSpec: ${{ item.py }}
displayName: 'Run pre-commits' displayName: 'Use Python ${{ item.py }}'
- script: | - script: |
python -m pip install --upgrade pip==23.0.1 python -m pip install pre-commit
pip install wheel==0.38.4 --upgrade pre-commit install
pip install setuptools==66 --upgrade pre-commit run --all-files
pip install build==0.10.0 displayName: 'Run pre-commits'
pip install pytest-azurepipelines
displayName: 'Install build dependencies'
- script: | - script: |
python -m build python -m pip install --upgrade pip==23.0.1
displayName: 'Build PrimAITE' pip install wheel==0.38.4 --upgrade
pip install setuptools==66 --upgrade
pip install build==0.10.0
pip install pytest-azurepipelines
displayName: 'Install build dependencies'
- script: | - script: |
PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl) python -m build
python -m pip install $PRIMAITE_WHEEL[dev] displayName: 'Build PrimAITE'
displayName: 'Install PrimAITE'
condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' ))
- script: | - script: |
forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]" PRIMAITE_WHEEL=$(ls ./dist/primaite*.whl)
displayName: 'Install PrimAITE' python -m pip install $PRIMAITE_WHEEL[dev]
condition: eq( variables['Agent.OS'], 'Windows_NT' ) displayName: 'Install PrimAITE'
condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' ))
- script: | - script: |
primaite setup forfiles /p dist\ /m *.whl /c "cmd /c python -m pip install @file[dev]"
displayName: 'Perform PrimAITE Setup' displayName: 'Install PrimAITE'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: | - script: |
pytest tests/ primaite setup
displayName: 'Run tests' displayName: 'Perform PrimAITE Setup'
- script: |
pytest tests/
displayName: 'Run tests'