aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Pasquet <dev@etenil.net>2022-02-15 21:25:13 +0000
committerGuillaume Pasquet <dev@etenil.net>2022-02-15 21:25:13 +0000
commited5090e427d05a0c8d413c20b754a93214034db2 (patch)
treeebf8ff7ed8668b1e7a27497761ea8e9ed3f1a22b
parent60f721b94ae70533a4a6ee9ffa7d24e5a19abff5 (diff)
Add gitlab-ci
-rw-r--r--.gitlab-ci.yml33
-rw-r--r--src/barbfile.rs4
-rw-r--r--src/executor.rs6
3 files changed, 27 insertions, 16 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 776bc61..067a689 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,12 +1,25 @@
-# You can override the included template(s) by including variable overrides
-# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
-# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
-# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
-# Note that environment variables can be set in several places
-# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
stages:
-- test
-sast:
+ - test
+
+variables:
+ CARGO_INCREMENTAL: 0
+
+test:
stage: test
-include:
-- template: Security/SAST.gitlab-ci.yml
+ script:
+ - cargo test --all --verbose
+
+# pretty:
+# stage: test
+# allow_failure: true
+# before_script:
+# - rustup component add rustfmt
+# script:
+# - cargo fmt -- --check
+
+# petty:
+# stage: test
+# before_script:
+# - rustup component add clippy
+# script:
+# - cargo clippy --all
diff --git a/src/barbfile.rs b/src/barbfile.rs
index 39e4485..a039253 100644
--- a/src/barbfile.rs
+++ b/src/barbfile.rs
@@ -53,7 +53,7 @@ impl Method {
match self {
Method::GET => false,
Method::DELETE => false,
- _ => true
+ _ => true,
}
}
}
@@ -173,7 +173,7 @@ impl FromStr for BarbFile {
Ok(BarbFile {
header: BarbHeader::new(method, url, headers, filter),
- body: if body == "" {None} else {Some(body)},
+ body: if body == "" { None } else { Some(body) },
})
}
}
diff --git a/src/executor.rs b/src/executor.rs
index 189df6f..ef97ace 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -20,7 +20,7 @@ impl Context {
pub fn empty() -> Context {
Context {
- vars: HashMap::new()
+ vars: HashMap::new(),
}
}
@@ -52,9 +52,7 @@ pub struct Executor {
impl Executor {
pub fn new(context: Context) -> Executor {
- Executor {
- context
- }
+ Executor { context }
}
pub fn execute(&mut self, bfile: BarbFile) -> Result<ureq::Response, String> {