summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory <chmln@users.noreply.github.com>2020-03-18 20:15:52 -0400
committerGitHub <noreply@github.com>2020-03-18 20:15:52 -0400
commit3cd464cce9aa90a198ee1cb6d3ccda135be4e299 (patch)
tree0bc62dcd546ede4144965361333b10b22f8eb85a
parent0cfe1b766cc622fffbabdb1234abbb6a018d28d0 (diff)
Upgrade Azure Pipelines (#65)
* Update azure pipeline config * iterate * Depend on master * Depend on master: take 2 * Depend on master: take 3 * cargo fmt * Remove min rust version check * Attempt to remove MSRV test * Attempt to remove MSRV test: fix jobs template path * Attempt to remove MSRV test: fix jobs template path * Attempt to remove MSRV test: fix jobs template path
-rw-r--r--.rustfmt.toml5
-rw-r--r--azure-pipelines.yml71
-rw-r--r--src/input.rs6
3 files changed, 25 insertions, 57 deletions
diff --git a/.rustfmt.toml b/.rustfmt.toml
index a4d7b38..769896d 100644
--- a/.rustfmt.toml
+++ b/.rustfmt.toml
@@ -1,8 +1,3 @@
edition = "2018"
max_width = 80
-wrap_comments = true
-format_strings = true
-merge_imports = true
-match_block_trailing_comma = true
-reorder_impl_items = true
use_field_init_shorthand = true
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 5bc05aa..cd1f22a 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -6,57 +6,30 @@ trigger:
resources:
repositories:
- - repository: templates
+ - repository: rust_pipelines
type: github
name: xoac/rust-azure-pipelines
- ref: refs/tags/v0.0.2
+ ref: refs/heads/master
endpoint: githubConnection
+stages:
+- stage: test
+ displayName: "Test"
+ jobs:
+ - template: ci/jobs/cargo-test.yaml@rust_pipelines
-jobs:
-# This represents the minimum Rust version supported.
-# Tests are not run as tests may require newer versions of rust.
-- template: ci/cargo-check.yml@templates
- parameters:
- name: minrust
- rust_version: 1.31.0 # The 2018 edition
- displayName: Check rust min ver
-
-################
-# Test stage #
-###############
-
-# Test stable
-- template: ci/test.yml@templates
- parameters:
- name: cargo_test_stable
- displayName: Cargo test
- cross: true # Test on Windows and macOS
-
-###################
-# DEPLOY PART #
-###################
-
-# Release binary
-- template: ci/github-release.yml@templates
- parameters:
- name: github_release
- dependsOn:
- - minrust
- - cargo_test_stable
- rust_version: stable
- condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
- contents: |
- *
- !*.rlib
- !*.d
- !.*
- targets:
- - x86_64-unknown-linux-gnu
- - x86_64-unknown-linux-musl
- - x86_64-pc-windows-gnu
- - x86_64-pc-windows-msvc
- - x86_64-apple-darwin
- github:
- gitHubConnection: githubConnection
- repositoryName: chmln/sd
+- stage: build
+ displayName: "Build"
+ condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
+ dependsOn:
+ - test
+# Deploy binaries to github only if tags start with `v` for example `v0.1.5`
+- stage: deploy
+ displayName: "Deploy"
+ dependsOn:
+ - build
+ jobs:
+ - template: ci/scenarios/github/release.yml@rust_pipelines
+ parameters:
+ job_condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
+ gitHubConnection: githubConnection
diff --git a/src/input.rs b/src/input.rs
index 0a9da4d..e3cc882 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -133,7 +133,7 @@ impl Replacer {
}
Ok(())
- },
+ }
(Source::Files(paths), true) => {
use rayon::prelude::*;
@@ -145,7 +145,7 @@ impl Replacer {
});
Ok(())
- },
+ }
(Source::Files(paths), false) => {
let stdout = std::io::stdout();
let mut handle = stdout.lock();
@@ -157,7 +157,7 @@ impl Replacer {
Ok(())
})
- },
+ }
}
}
}