diff --git a/eng/ci/code-mirror.yml b/eng/ci/code-mirror.yml new file mode 100644 index 00000000..ee145b21 --- /dev/null +++ b/eng/ci/code-mirror.yml @@ -0,0 +1,18 @@ +trigger: + branches: + include: + - dev + - release/* + +resources: + repositories: + - repository: eng + type: git + name: engineering + ref: refs/tags/release + +variables: + - template: ci/variables/cfs.yml@eng + +extends: + template: ci/code-mirror.yml@eng diff --git a/eng/ci/official-build.yml b/eng/ci/official-build.yml new file mode 100644 index 00000000..2723cd57 --- /dev/null +++ b/eng/ci/official-build.yml @@ -0,0 +1,50 @@ +trigger: + batch: true + branches: + include: + - dev + - release/* + +# CI only, does not trigger on PRs. +pr: none + +schedules: + - cron: '0 0 * * MON' + displayName: At 12:00 AM, only on Monday + branches: + include: + - dev + always: true + +resources: + repositories: + - repository: 1es + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + - repository: eng + type: git + name: engineering + ref: refs/tags/release + +variables: + - template: ci/variables/build.yml@eng + - template: ci/variables/cfs.yml@eng + +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1es + parameters: + pool: + name: 1es-pool-azfunc + image: 1es-windows-2022 + os: windows + + stages: + - stage: Build + jobs: + - template: /eng/templates/build.yml@self + + - stage: RunTests + dependsOn: Build + jobs: + - template: /eng/templates/ci-tests.yml@self diff --git a/eng/ci/public-build.yml b/eng/ci/public-build.yml new file mode 100644 index 00000000..cac005a5 --- /dev/null +++ b/eng/ci/public-build.yml @@ -0,0 +1,43 @@ +trigger: + batch: true + branches: + include: + - dev + +pr: + branches: + include: + - dev + +schedules: + - cron: '0 0 * * MON' + displayName: At 12:00 AM, only on Monday + branches: + include: + - dev + always: true + +resources: + repositories: + - repository: 1es + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +extends: + template: v1/1ES.Unofficial.PipelineTemplate.yml@1es + parameters: + pool: + name: 1es-pool-azfunc-public + image: 1es-windows-2022 + os: windows + + stages: + - stage: Build + jobs: + - template: /eng/templates/build.yml@self + + - stage: RunTests + dependsOn: Build + jobs: + - template: /eng/templates/ci-tests.yml@self diff --git a/eng/templates/build.yml b/eng/templates/build.yml new file mode 100644 index 00000000..58259d46 --- /dev/null +++ b/eng/templates/build.yml @@ -0,0 +1,21 @@ +jobs: + - job: "Build" + displayName: 'Build Python SDK' + + pool: + name: 1es-pool-azfunc-public + image: 1es-windows-2022 + os: windows + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: "3.11" + - bash: | + python --version + displayName: 'Check python version' + - bash: | + python -m pip install -U pip + pip install twine wheel + python setup.py sdist bdist_wheel + displayName: 'Build Python SDK' diff --git a/eng/templates/ci-tests.yml b/eng/templates/ci-tests.yml new file mode 100644 index 00000000..33133d71 --- /dev/null +++ b/eng/templates/ci-tests.yml @@ -0,0 +1,32 @@ +jobs: + - job: "TestPython" + displayName: "Run Python SDK Unit Tests" + + pool: + name: 1es-pool-azfunc + image: 1es-ubuntu-22.04 + os: linux + + strategy: + matrix: + python-37: + PYTHON_VERSION: '3.7' + python-38: + PYTHON_VERSION: '3.8' + python-39: + PYTHON_VERSION: '3.9' + python-310: + PYTHON_VERSION: '3.10' + python-311: + PYTHON_VERSION: '3.11' + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: $(PYTHON_VERSION) + - bash: | + python -m pip install --upgrade pip + python -m pip install -U -e .[dev] + displayName: 'Install dependencies' + - bash: | + python -m pytest --cache-clear --cov=./azure --cov-report=xml --cov-branch tests + displayName: 'Test with pytest' \ No newline at end of file