chore: Pass along improvements

This commit is contained in:
Ed Page 2021-02-04 21:46:38 -06:00
parent d6fa23b4a9
commit c0b942abde
3 changed files with 74 additions and 35 deletions

View file

@ -3,6 +3,15 @@ trigger:
include: ['master'] include: ['master']
tags: tags:
include: ['v*'] include: ['v*']
pr:
branches:
include:
- master
paths:
exclude:
- "*.md"
- "docs/*"
- "LICENSE-*"
schedules: schedules:
- cron: "3 3 3 * *" - cron: "3 3 3 * *"
displayName: Monthly Build displayName: Monthly Build
@ -10,7 +19,7 @@ schedules:
include: include:
- master - master
variables: variables:
minrust: 1.47.0 minrust: 1.49.0
codecov_token: $(CODECOV_TOKEN_SECRET) codecov_token: $(CODECOV_TOKEN_SECRET)
windows_vm: vs2017-win2016 windows_vm: vs2017-win2016
mac_vm: macos-10.14 mac_vm: macos-10.14
@ -28,18 +37,9 @@ stages:
- template: install-rust.yml@templates - template: install-rust.yml@templates
parameters: parameters:
rust: stable rust: stable
- script: cargo check --all --bins --examples --tests - script: cargo check --workspace --locked
displayName: Default features displayName: Check that Cargo.lock is satisfiable
- job: cargo_check_bench - script: cargo check --workspace --all-targets
displayName: cargo check --benches
pool:
vmImage: ${{ variables.linux_vm }}
continueOnError: true
steps:
- template: install-rust.yml@templates
parameters:
rust: nightly
- script: cargo check --all --benches
displayName: Default features displayName: Default features
- stage: test - stage: test
displayName: Test displayName: Test
@ -60,15 +60,25 @@ stages:
imageName: ${{ variables.linux_vm }} imageName: ${{ variables.linux_vm }}
target: 'x86_64-unknown-linux-gnu' target: 'x86_64-unknown-linux-gnu'
channel: stable channel: stable
# Check for upcoming platform-specific compiler breakages
windows_beta:
imageName: ${{ variables.windows_vm }}
target: 'x86_64-pc-windows-msvc'
channel: beta
mac_beta:
imageName: ${{ variables.mac_vm }}
target: 'x86_64-apple-darwin'
channel: beta
linux_beta: linux_beta:
imageName: ${{ variables.linux_vm }} imageName: ${{ variables.linux_vm }}
target: 'x86_64-unknown-linux-gnu' target: 'x86_64-unknown-linux-gnu'
channel: beta channel: beta
# Check for compiler breakages
linux_nightly: linux_nightly:
imageName: ${{ variables.linux_vm }} imageName: ${{ variables.linux_vm }}
target: 'x86_64-unknown-linux-gnu' target: 'x86_64-unknown-linux-gnu'
channel: nightly channel: nightly
continueOnError: ${{ eq(variables.channel, 'nightly') }} continueOnError: $[ne(variables.channel, 'stable')]
pool: pool:
vmImage: $(imageName) vmImage: $(imageName)
steps: steps:
@ -76,9 +86,9 @@ stages:
parameters: parameters:
rust: $(channel) rust: $(channel)
targets: ["$(TARGET)"] targets: ["$(TARGET)"]
- script: cargo test --target $(TARGET) --all - script: cargo test --target $(TARGET) --workspace
displayName: cargo test displayName: cargo test
- script: cargo doc --target $(TARGET) --no-deps --all - script: cargo doc --target $(TARGET) --workspace --no-deps
displayName: cargo doc displayName: cargo doc
- job: msrv - job: msrv
displayName: "${{ format('Minimum supported Rust version: {0}', variables.minrust) }}" displayName: "${{ format('Minimum supported Rust version: {0}', variables.minrust) }}"
@ -89,13 +99,14 @@ stages:
- template: install-rust.yml@templates - template: install-rust.yml@templates
parameters: parameters:
rust: ${{ variables.minrust }} rust: ${{ variables.minrust }}
- script: cargo check --all - script: cargo check --all --bins --examples --tests
displayName: cargo check displayName: cargo check
- stage: style - stage: style
displayName: Style checks displayName: Style checks
dependsOn: [] dependsOn: []
jobs: jobs:
- job: "Committed" - job: "Committed"
displayName: Linting commit history
pool: pool:
vmImage: ${{ variables.linux_vm }} vmImage: ${{ variables.linux_vm }}
steps: steps:
@ -106,19 +117,38 @@ stages:
target: 'x86_64-unknown-linux-gnu' target: 'x86_64-unknown-linux-gnu'
to: $(Build.StagingDirectory)/tools to: $(Build.StagingDirectory)/tools
- script: | - script: |
echo "This project uses Conventional style, see https://www.conventionalcommits.org" echo "Linting commits:"
git log --graph --oneline HEAD~..HEAD^2
echo "Against 'committed.toml':"
$(Build.StagingDirectory)/tools/committed --dump-config -
echo ""
echo "If this fails, don't sweat it. We're trying to encourage clear communication and not hinder contributions."
echo "If it is a reasonable issue and you lack time or feel uncomfortable fixing it yourself,"
echo "let us know and we can mentor or fix it."
$(Build.StagingDirectory)/tools/committed HEAD~..HEAD^2 --no-merge-commit -vv $(Build.StagingDirectory)/tools/committed HEAD~..HEAD^2 --no-merge-commit -vv
displayName: Committed displayName: Lint commit history
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
- job: style - job: style
displayName: Style linting displayName: Style checking
pool:
vmImage: ${{ variables.linux_vm }}
steps:
- template: install-rust.yml@templates
parameters:
rust: stable
components:
- rustfmt
- script: cargo fmt --all -- --check
displayName: rustfmt
- job: lint
displayName: Linting
strategy: strategy:
matrix: matrix:
current: current:
channel: stable channel: ${{ variables.minrust }}
next: next:
channel: beta channel: stable
continueOnError: ${{ eq(variables.channel, 'beta') }} continueOnError: $[eq(variables.channel, 'stable')]
pool: pool:
vmImage: ${{ variables.linux_vm }} vmImage: ${{ variables.linux_vm }}
steps: steps:
@ -126,15 +156,12 @@ stages:
parameters: parameters:
rust: $(channel) rust: $(channel)
components: components:
- rustfmt
- clippy - clippy
- script: cargo fmt --all -- --check - script: cargo check --workspace --all-targets --all-features
displayName: rustfmt
- script: cargo check --all
displayName: Warnings displayName: Warnings
env: env:
RUSTFLAGS: "-D warnings" RUSTFLAGS: "-D warnings"
- script: cargo clippy --all -- -D warnings - script: cargo clippy --workspace --all-features --all-targets -- -D warnings
displayName: clippy displayName: clippy
- ${{ if ne('', variables.codecov_token) }}: - ${{ if ne('', variables.codecov_token) }}:
- stage: coverage - stage: coverage
@ -174,8 +201,9 @@ stages:
- script: | - script: |
cargo run --package varcon-codegen -- --output crates/varcon/src/codegen.rs --check cargo run --package varcon-codegen -- --output crates/varcon/src/codegen.rs --check
displayName: Verify varcon-dict displayName: Verify varcon-dict
- stage: Release - stage: release
dependsOn: test displayName: Release
dependsOn: []
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/') condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
jobs: jobs:
- job: - job:
@ -197,8 +225,11 @@ stages:
vmImage: $(imageName) vmImage: $(imageName)
steps: steps:
- template: install-rust.yml@templates - template: install-rust.yml@templates
parameters:
rust: stable
targets: ["$(TARGET)"]
- script: | - script: |
cargo rustc --target $(TARGET) --release --bin $(CRATE_NAME) -- -C lto cargo build --target $(TARGET) --release --bin $(CRATE_NAME)
displayName: Build displayName: Build
- task: CopyFiles@2 - task: CopyFiles@2
displayName: Stage assets displayName: Stage assets

View file

@ -1,2 +1,3 @@
style="conventional" style="conventional"
ignore_author_re="dependabot" ignore_author_re="dependabot"
merge_commit = false

View file

@ -1,4 +1,11 @@
pre-release-commit-message = "chore({{crate_name}}): Release {{version}}" pre-release-commit-message = "chore({{crate_name}}): Release {{version}}"
no-dev-version = true no-dev-version = true
tag-message = "{{prefix}}v{{version}}" tag-message = "{{tag_name}}"
tag-name = "{{prefix}}v{{version}}" tag-name = "{{prefix}}v{{version}}"
pre-release-replacements = [
{file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1},
{file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1},
{file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1},
{file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate\n", exactly=1},
{file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/assert-rs/predicates-rs/compare/{{tag_name}}...HEAD", exactly=1},
]