mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-21 16:41:01 -05:00
fix(ci): Report more failures
This commit is contained in:
parent
bc1302f01b
commit
5d7e91d214
5 changed files with 143 additions and 40 deletions
|
@ -9,22 +9,148 @@ schedules:
|
|||
branches:
|
||||
include:
|
||||
- master
|
||||
variables:
|
||||
minrust: 1.40.0
|
||||
codecov_token: $(CODECOV_TOKEN_SECRET)
|
||||
windows_vm: vs2017-win2016
|
||||
mac_vm: macos-10.14
|
||||
linux_vm: ubuntu-16.04
|
||||
|
||||
stages:
|
||||
- stage: check
|
||||
displayName: Compilation Check
|
||||
jobs:
|
||||
- job: cargo_check
|
||||
displayName: cargo check
|
||||
pool:
|
||||
vmImage: ${{ variables.linux_vm }}
|
||||
steps:
|
||||
- template: install-rust.yml@templates
|
||||
parameters:
|
||||
rust: stable
|
||||
- script: cargo check --all --bins --examples --tests
|
||||
displayName: Default features
|
||||
- job: cargo_check_bench
|
||||
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
|
||||
- stage: test
|
||||
displayName: Test
|
||||
jobs:
|
||||
- job: test
|
||||
displayName: Test
|
||||
strategy:
|
||||
matrix:
|
||||
windows:
|
||||
imageName: ${{ variables.windows_vm }}
|
||||
target: 'x86_64-pc-windows-msvc'
|
||||
channel: stable
|
||||
mac:
|
||||
imageName: ${{ variables.mac_vm }}
|
||||
target: 'x86_64-apple-darwin'
|
||||
channel: stable
|
||||
linux:
|
||||
imageName: ${{ variables.linux_vm }}
|
||||
target: 'x86_64-unknown-linux-gnu'
|
||||
channel: stable
|
||||
linux_beta:
|
||||
imageName: ${{ variables.linux_vm }}
|
||||
target: 'x86_64-unknown-linux-gnu'
|
||||
channel: beta
|
||||
linux_nightly:
|
||||
imageName: ${{ variables.linux_vm }}
|
||||
target: 'x86_64-unknown-linux-gnu'
|
||||
channel: nightly
|
||||
continueOnError: ${{ eq(variables.channel, 'nightly') }}
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
steps:
|
||||
- template: install-rust.yml@templates
|
||||
parameters:
|
||||
rust: $(channel)
|
||||
targets: ["$(TARGET)"]
|
||||
- script: cargo test --target $(TARGET) --all
|
||||
displayName: cargo test
|
||||
- script: cargo doc --target $(TARGET) --no-deps --all
|
||||
displayName: cargo doc
|
||||
- job: msrv
|
||||
displayName: "${{ format('Minimum supported Rust version: {0}', variables.minrust) }}"
|
||||
dependsOn: []
|
||||
pool:
|
||||
vmImage: ${{ variables.linux_vm }}
|
||||
steps:
|
||||
- template: install-rust.yml@templates
|
||||
parameters:
|
||||
rust: ${{ variables.minrust }}
|
||||
- script: cargo check --all
|
||||
displayName: cargo check
|
||||
- stage: style
|
||||
displayName: Style checks
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: default.yml@templates
|
||||
parameters:
|
||||
minrust: 1.40.0
|
||||
codecov_token: $(CODECOV_TOKEN_SECRET)
|
||||
- job: "Committed"
|
||||
pool:
|
||||
vmImage: ${{ variables.linux_vm }}
|
||||
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'))
|
||||
- job: style
|
||||
displayName: Style linting
|
||||
strategy:
|
||||
matrix:
|
||||
current:
|
||||
channel: stable
|
||||
next:
|
||||
channel: beta
|
||||
continueOnError: ${{ eq(variables.channel, 'beta') }}
|
||||
pool:
|
||||
vmImage: ${{ variables.linux_vm }}
|
||||
steps:
|
||||
- template: install-rust.yml@templates
|
||||
parameters:
|
||||
rust: $(channel)
|
||||
components:
|
||||
- rustfmt
|
||||
- clippy
|
||||
- script: cargo fmt --all -- --check
|
||||
displayName: rustfmt
|
||||
- script: cargo check --all
|
||||
displayName: Warnings
|
||||
env:
|
||||
RUSTFLAGS: "-D warnings"
|
||||
- script: cargo clippy --all -- -D warnings
|
||||
displayName: clippy
|
||||
- ${{ if ne('', variables.codecov_token) }}:
|
||||
- stage: coverage
|
||||
displayName: Code coverage
|
||||
dependsOn: test
|
||||
jobs:
|
||||
- template: coverage.yml@templates
|
||||
parameters:
|
||||
token: ${{ variables.codecov_token }}
|
||||
- stage: codegen
|
||||
displayName: Verify Code-gen
|
||||
dependsOn: []
|
||||
dependsOn: ["check"]
|
||||
jobs:
|
||||
- job: codegen
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
vmImage: ${{ variables.linux_vm }}
|
||||
steps:
|
||||
- template: install-rust.yml@templates
|
||||
- script: |
|
||||
|
@ -42,25 +168,6 @@ stages:
|
|||
- script: |
|
||||
cargo run --package varcon-codegen -- --output crates/varcon/src/codegen.rs --check
|
||||
displayName: Verify varcon-dict
|
||||
- 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'))
|
||||
- stage: Release
|
||||
dependsOn: test
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
||||
|
@ -69,15 +176,15 @@ stages:
|
|||
strategy:
|
||||
matrix:
|
||||
windows:
|
||||
imageName: 'vs2017-win2016'
|
||||
imageName: ${{ variables.windows_vm }}
|
||||
target: 'x86_64-pc-windows-msvc'
|
||||
crate_name: typos
|
||||
mac:
|
||||
imageName: 'macos-10.14'
|
||||
imageName: ${{ variables.mac_vm }}
|
||||
target: 'x86_64-apple-darwin'
|
||||
crate_name: typos
|
||||
linux:
|
||||
imageName: 'ubuntu-16.04'
|
||||
imageName: ${{ variables.linux_vm }}
|
||||
target: 'x86_64-unknown-linux-gnu'
|
||||
crate_name: typos
|
||||
pool:
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::needless_update)]
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::io::{self, Write};
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ fn generate<W: std::io::Write>(file: &mut W) {
|
|||
writeln!(file, "use crate::*;").unwrap();
|
||||
writeln!(file).unwrap();
|
||||
|
||||
writeln!(file, "pub static VARCON: &'static [Cluster] = &[").unwrap();
|
||||
writeln!(file, "pub static VARCON: &[Cluster] = &[").unwrap();
|
||||
for mut cluster in clusters {
|
||||
cluster.infer();
|
||||
writeln!(file, "Cluster {{").unwrap();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
use crate::*;
|
||||
|
||||
pub static VARCON: &'static [Cluster] = &[
|
||||
pub static VARCON: &[Cluster] = &[
|
||||
Cluster {
|
||||
header: Some("abettor <verified> (level 50)"),
|
||||
entries: &[
|
||||
|
|
|
@ -291,10 +291,7 @@ impl FileConfig {
|
|||
}
|
||||
|
||||
pub fn identifier_leading_chars(&self) -> &str {
|
||||
self.identifier_leading_chars
|
||||
.as_ref()
|
||||
.map(|s| s.as_str())
|
||||
.unwrap_or("_")
|
||||
self.identifier_leading_chars.as_deref().unwrap_or("_")
|
||||
}
|
||||
|
||||
pub fn identifier_include_digits(&self) -> bool {
|
||||
|
@ -302,10 +299,7 @@ impl FileConfig {
|
|||
}
|
||||
|
||||
pub fn identifier_include_chars(&self) -> &str {
|
||||
self.identifier_include_chars
|
||||
.as_ref()
|
||||
.map(|s| s.as_str())
|
||||
.unwrap_or("_'")
|
||||
self.identifier_include_chars.as_deref().unwrap_or("_'")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -327,7 +321,7 @@ impl FileSource for FileConfig {
|
|||
}
|
||||
|
||||
fn identifier_leading_chars(&self) -> Option<&str> {
|
||||
self.identifier_leading_chars.as_ref().map(|s| s.as_str())
|
||||
self.identifier_leading_chars.as_deref()
|
||||
}
|
||||
|
||||
fn identifier_include_digits(&self) -> Option<bool> {
|
||||
|
@ -335,7 +329,7 @@ impl FileSource for FileConfig {
|
|||
}
|
||||
|
||||
fn identifier_include_chars(&self) -> Option<&str> {
|
||||
self.identifier_include_chars.as_ref().map(|s| s.as_str())
|
||||
self.identifier_include_chars.as_deref()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue