diff --git a/eng/ci/official-build.yml b/eng/ci/official-build.yml new file mode 100644 index 00000000..9e33059d --- /dev/null +++ b/eng/ci/official-build.yml @@ -0,0 +1,36 @@ +variables: + - template: ci/variables/cfs.yml@eng + +trigger: + batch: true + branches: + include: + - main + +# CI only, does not trigger on PRs. +pr: none + +resources: + repositories: + - repository: 1es + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + - repository: eng + type: git + name: engineering + ref: refs/tags/release + +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1es + parameters: + pool: + name: 1es-pool-azfunc + image: 1es-windows-2022 + os: windows + + stages: + - stage: BuildAndSign + dependsOn: [] + jobs: + - template: /eng/templates/build.yml@self \ No newline at end of file diff --git a/eng/templates/build.yml b/eng/templates/build.yml new file mode 100644 index 00000000..d1b611f6 --- /dev/null +++ b/eng/templates/build.yml @@ -0,0 +1,42 @@ +jobs: + - job: Build + + templateContext: + outputs: + - output: pipelineArtifact + path: $(build.artifactStagingDirectory) + artifact: drop + sbomBuildDropPath: $(System.DefaultWorkingDirectory) + sbomPackageName: 'Durable Functions Python' + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7.x' + - script: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install wheel + workingDirectory: $(System.DefaultWorkingDirectory) + displayName: 'Install dependencies' + + - script: | + cd azure + flake8 . --count --show-source --statistics + displayName: 'Run lint test with flake8' + + - script: | + pip install pytest pytest-azurepipelines + pytest + displayName: 'pytest' + - script: | + python setup.py sdist bdist_wheel + workingDirectory: $(System.DefaultWorkingDirectory) + displayName: 'Building' + + - task: CopyFiles@2 + displayName: 'Copy publish file to Artifact Staging Directory' + inputs: + SourceFolder: dist + Contents: '**' + TargetFolder: $(Build.ArtifactStagingDirectory) \ No newline at end of file