Skip to content

Commit

Permalink
chore(CI): Add validation pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 1, 2019
1 parent b7ea5e7 commit a6b5b09
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 2 deletions.
100 changes: 99 additions & 1 deletion azure-pipelines.yml
Expand Up @@ -4,15 +4,87 @@ schedules:
branches:
include:
- master
variables:
windows_vm: vs2017-win2016
mac_vm: macos-10.14
linux_vm: ubuntu-16.04
rust_style: 1.35.0

stages:
- stage: check
displayName: Compilation Check
jobs:
- job: cargo_check
displayName: cargo check
pool:
vmImage: ${{ variables.linux_vm }}
steps:
- template: azure/install-rust.yml@templates
parameters:
rust: stable
- script: cargo check --all --locked
displayName: Check that Cargo.lock is satisfiable
- script: cargo check --all --bins --examples --tests
displayName: Default features
- script: cargo check --all --bins --examples --tests --no-default-features
displayName: No features
- script: cargo check --all --bins --examples --tests --all-features
displayName: All 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
windows_beta:
imageName: ${{ variables.windows_vm }}
channel: beta
windows_nightly:
imageName: ${{ variables.windows_vm }}
channel: nightly
mac:
imageName: ${{ variables.mac_vm }}
channel: stable
mac_beta:
imageName: ${{ variables.mac_vm }}
channel: beta
mac_nightly:
imageName: ${{ variables.mac_vm }}
channel: nightly
linux:
imageName: ${{ variables.linux_vm }}
channel: stable
linux_beta:
imageName: ${{ variables.linux_vm }}
channel: beta
linux_nightly:
imageName: ${{ variables.linux_vm }}
channel: nightly
continueOnError: ${{ eq(variables.channel, 'nightly') }}
pool:
vmImage: $(imageName)
steps:
- template: azure/install-rust.yml@templates
parameters:
rust: $(channel)
- script: cargo test --all
displayName: Default features
- script: cargo test --all --no-default-features
displayName: No features
- script: cargo test --all --all-features
displayName: All features
- stage: style
displayName: Style checks
dependsOn: []
jobs:
- job: "Committed"
pool:
vmImage: 'ubuntu-16.04'
vmImage: ${{ variables.linux_vm }}
steps:
- checkout: self
- template: v1/azdo-step.yml@gh-install
Expand All @@ -23,6 +95,32 @@ stages:
- script: $(Build.StagingDirectory)/tools/committed HEAD~..HEAD^2 --no-merge-commit -vv
displayName: Committed
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
- job: rust_style
displayName: Rust Style
strategy:
matrix:
current:
channel: ${{ variables.rust_style }}
next:
channel: stable
continueOnError: ${{ eq(variables.channel, 'stable') }}
pool:
vmImage: ${{ variables.linux_vm }}
steps:
- template: azure/install-rust.yml@templates
parameters:
rust: stable
components:
- rustfmt
- clippy
- script: cargo fmt --all -- --check
displayName: rustfmt
- script: cargo check --all --bins --examples --tests --all-features
displayName: Warnings
env:
RUSTFLAGS: "-D warnings"
- script: cargo clippy --all
displayName: clippy

resources:
repositories:
Expand Down
6 changes: 5 additions & 1 deletion src/syntax_highlight/syntect.rs
Expand Up @@ -70,7 +70,11 @@ struct CodeBlock {
}

impl Renderable for CodeBlock {
fn render_to(&self, writer: &mut dyn Write, _context: &mut Context) -> Result<(), liquid::Error> {
fn render_to(
&self,
writer: &mut dyn Write,
_context: &mut Context,
) -> Result<(), liquid::Error> {
let syntax = match self.lang {
Some(ref lang) => SETUP.syntax_set.find_syntax_by_token(lang),
_ => None,
Expand Down

0 comments on commit a6b5b09

Please sign in to comment.