-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
85 lines (79 loc) · 3.08 KB
/
azure-pipelines.yml
File metadata and controls
85 lines (79 loc) · 3.08 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
# Imports the shared Azure CI tools from the master branch of shotgunsoftware/tk-ci-tools
resources:
repositories:
- repository: templates
type: github
name: shotgunsoftware/tk-ci-tools
ref: refs/heads/master
endpoint: shotgunsoftware
# We want builds to trigger for 3 reasons:
# - The master branch sees new commits
# - Each PR should get rebuilt when commits are added to it.
# - When we tag something
trigger:
branches:
include:
- master
tags:
include:
- v*
pr:
branches:
include:
- "*"
# This pulls in a variable group from Azure. Variables can be encrypted or not.
variables:
- group: deploy-secrets
# Launch into the build pipeline.
jobs:
- template: build-pipeline.yml@templates
parameters:
additional_repositories:
- name: tk-framework-desktopclient
- name: tk-shotgun
extra_test_dependencies:
# CI installs dependencies from the dedicated Azure Pipelines
# requirements file, which must be kept in sync with the unified
# runtime requirements so CI-installed versions match what pkgs.zip
# bundles, preventing sys.modules version conflicts.
- --requirement=azure-pipelines/requirements.txt
post_tests_steps:
- task: Bash@3
displayName: Run interpreter integration tests
inputs:
targetType: inline
script: |
python -m pytest \
--cov \
--nunit-xml=test-results-interpreters.xml \
--verbose \
tests/integration_tests/interpreters.py
env:
CI: 1 # Used to skip certain tests on Azure
COVERAGE_FILE: .coverage.interpreters
# Use a specific name so tk-ci-tools will properly coverage combine
SHOTGUN_HOST: $(sg.ci.host)
SHOTGUN_SCRIPT_NAME: $(sg.ci.script.name)
SHOTGUN_SCRIPT_KEY: $(sg.ci.script.key)
TK_TOOLCHAIN_HOST: $(sg.ci.host)
TK_TOOLCHAIN_USER_LOGIN: $(sg.ci.human.login)
TK_TOOLCHAIN_USER_PASSWORD: $(sg.ci.human.password)
# Sandbox each test executing based on the Azure agent name. Those are
# Azure Pipelines 1-10
SHOTGUN_TEST_ENTITY_SUFFIX: '$(Agent.Name)'
# 3rd-party package regeneration pipeline.
- ${{ if and(ne(variables['Build.SourceBranch'], 'refs/heads/master'), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/'))) }}:
# Compile-time guard: excludes master and tags (Build.SourceBranch is reliable
# at compile time for those cases).
# Runtime guard (job_condition): skips all jobs when the PR source branch ends
# with '-automated' or '-no-rebuild', preventing the generated branch's own PR
# from re-triggering. System.PullRequest.SourceBranch is only reliable at
# runtime, not in ${{ if }} expressions.
- template: resources/python/pipelines/pipelines.yml
parameters:
branch: $(System.PullRequest.SourceBranch)-automated
job_condition: >-
not(or(
endsWith(variables['System.PullRequest.SourceBranch'], '-automated'),
endsWith(variables['System.PullRequest.SourceBranch'], '-no-rebuild')
))