typos/azure-pipelines.yml

151 lines
5 KiB
YAML
Raw Normal View History

2019-10-25 09:32:34 -04:00
trigger:
branches:
include: ['master']
tags:
include: ['v*']
schedules:
- cron: "3 3 3 * *"
displayName: Monthly Build
branches:
include:
- master
stages:
2020-01-01 16:52:12 -05:00
- stage: test
- template: default.yml@templates
parameters:
minrust: 1.36.0
codecov_token: $(CODECOV_TOKEN_SECRET)
2019-10-25 09:41:36 -04:00
- stage: codegen
displayName: Verify Code-gen
dependsOn: []
jobs:
- job: codegen
pool:
vmImage: 'ubuntu-16.04'
steps:
- template: azure/install-rust.yml@templates
- script: |
2019-10-28 12:09:29 -04:00
cargo run --package typos-codegen -- --output dict/typos/src/dict_codegen.rs --check
2019-10-28 12:01:22 -04:00
displayName: Verify typos-dict
- script: |
cargo run --package codespell-codegen -- --output dict/codespell/src/dict_codegen.rs --check
displayName: Verify codespell-dict
- script: |
cargo run --package misspell-codegen -- --output dict/misspell/src/dict_codegen.rs --check
displayName: Verify misspell-dict
2019-10-28 15:39:59 -04:00
- script: |
cargo run --package wikipedia-codegen -- --output dict/wikipedia/src/dict_codegen.rs --check
displayName: Verify wikipedia-dict
2019-10-25 09:32:34 -04:00
- stage: committed
displayName: Lint History
dependsOn: []
jobs:
- job: "Committed"
pool:
vmImage: 'ubuntu-16.04'
steps:
- checkout: self
- template: v1/azdo-step.yml@gh-install
parameters:
git: crate-ci/committed
target: 'x86_64-unknown-linux-gnu'
to: $(Build.StagingDirectory)/tools
- script: |
echo "This project uses Conventional style, see https://www.conventionalcommits.org"
$(Build.StagingDirectory)/tools/committed HEAD~..HEAD^2 --no-merge-commit -vv
displayName: Committed
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
2019-10-25 09:37:41 -04:00
- stage: Release
dependsOn: test
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
jobs:
- job:
strategy:
matrix:
windows:
imageName: 'vs2017-win2016'
target: 'x86_64-pc-windows-msvc'
crate_name: typos
mac:
imageName: 'macos-10.14'
target: 'x86_64-apple-darwin'
crate_name: typos
linux:
imageName: 'ubuntu-16.04'
target: 'x86_64-unknown-linux-gnu'
crate_name: typos
pool:
vmImage: $(imageName)
steps:
- template: azure/install-rust.yml@templates
- script: |
cargo rustc --target $(TARGET) --release --bin $(CRATE_NAME) -- -C lto
2019-10-25 09:37:41 -04:00
displayName: Build
- task: CopyFiles@2
displayName: Stage assets
condition: ne( variables['Agent.OS'], 'Windows_NT' )
inputs:
sourceFolder: '$(Build.SourcesDirectory)/target/$(TARGET)/release'
contents: $(crate_name)
targetFolder: '$(Build.BinariesDirectory)/'
- task: CopyFiles@2
displayName: Stage assets on Windows
condition: eq( variables['Agent.OS'], 'Windows_NT' )
inputs:
sourceFolder: '$(Build.SourcesDirectory)/target/$(TARGET)/release'
contents: $(crate_name).exe
targetFolder: '$(Build.BinariesDirectory)/'
- task: ArchiveFiles@2
displayName: Tarball assets
condition: ne( variables['Agent.OS'], 'Windows_NT' )
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)/$(crate_name)'
archiveType: 'tar'
tarCompression: 'gz'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(crate_name)-$(Build.SourceBranchName)-$(TARGET).tar.gz'
- task: GithubRelease@0
condition: ne( variables['Agent.OS'], 'Windows_NT' )
inputs:
gitHubConnection: 'crate-ci-token'
repositoryName: 'crate-ci/typos'
action: 'edit'
target: '$(build.sourceVersion)'
tagSource: 'manual'
tag: '$(Build.SourceBranchName)'
assets: '$(Build.ArtifactStagingDirectory)/$(crate_name)-$(Build.SourceBranchName)-$(TARGET).tar.gz'
title: '$(Build.SourceBranchName)'
assetUploadMode: 'replace'
addChangeLog: true
- task: ArchiveFiles@2
displayName: Zip assets
condition: eq( variables['Agent.OS'], 'Windows_NT' )
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)/$(crate_name).exe'
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(crate_name)-$(Build.SourceBranchName)-$(TARGET).zip'
- task: GithubRelease@0
condition: eq( variables['Agent.OS'], 'Windows_NT' )
inputs:
gitHubConnection: 'crate-ci-token'
repositoryName: 'crate-ci/typos'
action: 'edit'
target: '$(build.sourceVersion)'
tagSource: 'manual'
tag: '$(Build.SourceBranchName)'
assets: '$(Build.ArtifactStagingDirectory)/$(crate_name)-$(Build.SourceBranchName)-$(TARGET).zip'
title: '$(Build.SourceBranchName)'
assetUploadMode: 'replace'
addChangeLog: true
2019-10-25 09:32:34 -04:00
resources:
repositories:
- repository: templates
type: github
name: crate-ci/azure-pipelines
endpoint: crate-ci
- repository: gh-install
type: github
name: crate-ci/gh-install
endpoint: crate-ci