From cd4075d294ed3a8ae95c5e95bac7aa720bf3e3f5 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 10 May 2021 21:52:24 +0200 Subject: [PATCH 01/20] [#45] First attempt at using S3 cache --- .woodpecker.yml | 74 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 10 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 45bb910..0711f6f 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,24 +1,78 @@ pipeline: + # Download the cache from S3 + restore-cache: + image: plugins/drone-s3-cache + pull: true + + endpoint: $S3_ENDPOINT + access_key: $S3_USER + secret_key: $S3_PASSWORD + root: fej_build-cache + restore: true + + secrets: [ s3_endpoint, s3_user, s3_password ] + + + # =====LINTING===== + lint-frontend: + image: node:15-alpine3.13 + group: lint + commands: + - cd web + - yarn run lint + + lint-backend: + image: chewingbever/fej-builder:latest + pull: true + group: lint + commands: + - cargo fmt -- --check + + + # =====BUILDING===== build-frontend: image: node:15-alpine3.13 - pull: true commands: - cd web - yarn install - yarn run build - lint-frontend: - image: node:15-alpine3.13 - commands: - - cd web - - yarn run lint - # This doesn't require compiling anything - lint-backend: + build-backend: image: chewingbever/fej-builder:latest - pull: true commands: - - cargo fmt -- --check + - cargo build + + + # =====TESTING===== + test-backend: + image: chewingbever/fej-builder:latest + commands: + # This is run here because it requires compilation + - cargo clippy -- --no-deps -D warnings + - cargo test + + + # =====REBUILD CACHE===== + rebuild-cache: + image: plugins/drone-s3-cache + + endpoint: $S3_ENDPOINT + access_key: $S3_USER + secret_key: $S3_PASSWORD + root: fej_build-cache + rebuild: true + flush: true + # Delete cache older than 30 days (might lower this) + flush_age: 30 + mount: + - target + - web/node_modules + + secrets: [ s3_endpoint, s3_user, s3_password ] + # Push the cache, even on failure + when: [ success, failure ] + # publish-builder: # image: plugins/docker From ff1631b5251db42a3ddf604bdd68cbb8725c588a Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 10 May 2021 21:54:03 +0200 Subject: [PATCH 02/20] [#45] Fixed first of probably many errors --- .woodpecker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 0711f6f..1a0bef0 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -71,7 +71,8 @@ pipeline: secrets: [ s3_endpoint, s3_user, s3_password ] # Push the cache, even on failure - when: [ success, failure ] + when: + status: [ success, failure ] # publish-builder: From 92c6e2c5cc6814769726b1585d277ab43c090250 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 10 May 2021 21:54:56 +0200 Subject: [PATCH 03/20] [#45] It's plugins/s3-cache dude --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1a0bef0..a990696 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,7 +1,7 @@ pipeline: # Download the cache from S3 restore-cache: - image: plugins/drone-s3-cache + image: plugins/s3-cache pull: true endpoint: $S3_ENDPOINT @@ -55,7 +55,7 @@ pipeline: # =====REBUILD CACHE===== rebuild-cache: - image: plugins/drone-s3-cache + image: plugins/s3-cache endpoint: $S3_ENDPOINT access_key: $S3_USER From 46667907842c434d1dbe20d05d7cce6fae18f233 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 10 May 2021 21:57:15 +0200 Subject: [PATCH 04/20] [#45] Edited broken env vars --- .woodpecker.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index a990696..706c517 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,9 +4,9 @@ pipeline: image: plugins/s3-cache pull: true - endpoint: $S3_ENDPOINT - access_key: $S3_USER - secret_key: $S3_PASSWORD + endpoint: ${S3_ENDPOINT} + access_key: ${S3_USER} + secret_key: ${S3_PASSWORD} root: fej_build-cache restore: true @@ -57,9 +57,9 @@ pipeline: rebuild-cache: image: plugins/s3-cache - endpoint: $S3_ENDPOINT - access_key: $S3_USER - secret_key: $S3_PASSWORD + endpoint: ${S3_ENDPOINT} + access_key: ${S3_USER} + secret_key: ${S3_PASSWORD} root: fej_build-cache rebuild: true flush: true From bd51b6ce148029b5042c8ecfdecf2e1cacc46902 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 10 May 2021 22:15:05 +0200 Subject: [PATCH 05/20] [#45] More updates to cicd file --- .woodpecker.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 706c517..2229146 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -7,7 +7,7 @@ pipeline: endpoint: ${S3_ENDPOINT} access_key: ${S3_USER} secret_key: ${S3_PASSWORD} - root: fej_build-cache + root: fej-build-cache restore: true secrets: [ s3_endpoint, s3_user, s3_password ] @@ -53,18 +53,15 @@ pipeline: - cargo test - # =====REBUILD CACHE===== + # =====REBUILD & FLUSH CACHE===== rebuild-cache: image: plugins/s3-cache endpoint: ${S3_ENDPOINT} access_key: ${S3_USER} secret_key: ${S3_PASSWORD} - root: fej_build-cache + root: fej-build-cache rebuild: true - flush: true - # Delete cache older than 30 days (might lower this) - flush_age: 30 mount: - target - web/node_modules @@ -74,6 +71,22 @@ pipeline: when: status: [ success, failure ] + flush-cache: + image: plugins/s3-cache + + endpoint: ${S3_ENDPOINT} + access_key: ${S3_USER} + secret_key: ${S3_PASSWORD} + root: fej-build-cache + flush: true + # Delete cache older than 30 days (might lower this) + flush_age: 30 + + secrets: [ s3_endpoint, s3_user, s3_password ] + # Push the cache, even on failure + when: + status: [ success, failure ] + # publish-builder: # image: plugins/docker From b8f31aa337cb48a133277643e7979b4a137f852f Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 10 May 2021 22:19:49 +0200 Subject: [PATCH 06/20] [#45] Renamed root --- .woodpecker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 2229146..602d04f 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -7,7 +7,7 @@ pipeline: endpoint: ${S3_ENDPOINT} access_key: ${S3_USER} secret_key: ${S3_PASSWORD} - root: fej-build-cache + root: build-cache restore: true secrets: [ s3_endpoint, s3_user, s3_password ] @@ -60,7 +60,7 @@ pipeline: endpoint: ${S3_ENDPOINT} access_key: ${S3_USER} secret_key: ${S3_PASSWORD} - root: fej-build-cache + root: build-cache rebuild: true mount: - target @@ -77,7 +77,7 @@ pipeline: endpoint: ${S3_ENDPOINT} access_key: ${S3_USER} secret_key: ${S3_PASSWORD} - root: fej-build-cache + root: build-cache flush: true # Delete cache older than 30 days (might lower this) flush_age: 30 From 9d065c229ea4de38a2cc896198be0422e0ac4c68 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 10 May 2021 22:21:56 +0200 Subject: [PATCH 07/20] [#45] Added path_style option --- .woodpecker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 602d04f..7652ea3 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -9,6 +9,7 @@ pipeline: secret_key: ${S3_PASSWORD} root: build-cache restore: true + path_style: true secrets: [ s3_endpoint, s3_user, s3_password ] @@ -62,6 +63,7 @@ pipeline: secret_key: ${S3_PASSWORD} root: build-cache rebuild: true + path_style: true mount: - target - web/node_modules @@ -79,6 +81,7 @@ pipeline: secret_key: ${S3_PASSWORD} root: build-cache flush: true + path_style: true # Delete cache older than 30 days (might lower this) flush_age: 30 From 0ec5e33860540956b54beb5c4891fec4c7b334a3 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 10 May 2021 22:22:51 +0200 Subject: [PATCH 08/20] [#45] Enabled debug logs for debugging --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 7652ea3..bf18661 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -10,6 +10,7 @@ pipeline: root: build-cache restore: true path_style: true + debug: true secrets: [ s3_endpoint, s3_user, s3_password ] From 63316314aadcbecbcb7ce22e6b3762e7f1b9e474 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 11 May 2021 20:43:51 +0200 Subject: [PATCH 09/20] [#45] Another try at fixing the ci --- .woodpecker.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index bf18661..45a12f3 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,15 +4,13 @@ pipeline: image: plugins/s3-cache pull: true - endpoint: ${S3_ENDPOINT} + endpoint: https://s3.roosens.me access_key: ${S3_USER} secret_key: ${S3_PASSWORD} - root: build-cache + root: /build-cache restore: true - path_style: true - debug: true - secrets: [ s3_endpoint, s3_user, s3_password ] + secrets: [ s3_user, s3_password ] # =====LINTING===== @@ -59,7 +57,7 @@ pipeline: rebuild-cache: image: plugins/s3-cache - endpoint: ${S3_ENDPOINT} + endpoint: https://s3.roosens.me access_key: ${S3_USER} secret_key: ${S3_PASSWORD} root: build-cache From 81c0d5e00b5b8710bdd65ff50406f21dd5e380dc Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 11 May 2021 21:19:18 +0200 Subject: [PATCH 10/20] [#45] Changed root style --- .woodpecker.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 45a12f3..2feb095 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -7,7 +7,7 @@ pipeline: endpoint: https://s3.roosens.me access_key: ${S3_USER} secret_key: ${S3_PASSWORD} - root: /build-cache + root: build-cache/ restore: true secrets: [ s3_user, s3_password ] @@ -60,14 +60,13 @@ pipeline: endpoint: https://s3.roosens.me access_key: ${S3_USER} secret_key: ${S3_PASSWORD} - root: build-cache + root: build-cache/ rebuild: true - path_style: true mount: - target - web/node_modules - secrets: [ s3_endpoint, s3_user, s3_password ] + secrets: [ s3_user, s3_password ] # Push the cache, even on failure when: status: [ success, failure ] @@ -75,16 +74,15 @@ pipeline: flush-cache: image: plugins/s3-cache - endpoint: ${S3_ENDPOINT} + endpoint: https://s3.roosens.me access_key: ${S3_USER} secret_key: ${S3_PASSWORD} - root: build-cache + root: build-cache/ flush: true - path_style: true # Delete cache older than 30 days (might lower this) flush_age: 30 - secrets: [ s3_endpoint, s3_user, s3_password ] + secrets: [ s3_user, s3_password ] # Push the cache, even on failure when: status: [ success, failure ] From 2a14703097b4eca5e88b9e347f7396ead4b6ca63 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 11 May 2021 21:38:19 +0200 Subject: [PATCH 11/20] [#45] Let's try some other env vars --- .woodpecker.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 2feb095..788d3c7 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -5,12 +5,10 @@ pipeline: pull: true endpoint: https://s3.roosens.me - access_key: ${S3_USER} - secret_key: ${S3_PASSWORD} root: build-cache/ restore: true - secrets: [ s3_user, s3_password ] + secrets: [ cache_s3_access_key, cache_s3_secret_key ] # =====LINTING===== @@ -58,15 +56,13 @@ pipeline: image: plugins/s3-cache endpoint: https://s3.roosens.me - access_key: ${S3_USER} - secret_key: ${S3_PASSWORD} root: build-cache/ rebuild: true mount: - target - web/node_modules - secrets: [ s3_user, s3_password ] + secrets: [ cache_s3_access_key, cache_s3_secret_key ] # Push the cache, even on failure when: status: [ success, failure ] @@ -75,14 +71,12 @@ pipeline: image: plugins/s3-cache endpoint: https://s3.roosens.me - access_key: ${S3_USER} - secret_key: ${S3_PASSWORD} root: build-cache/ flush: true # Delete cache older than 30 days (might lower this) flush_age: 30 - secrets: [ s3_user, s3_password ] + secrets: [ cache_s3_access_key, cache_s3_secret_key ] # Push the cache, even on failure when: status: [ success, failure ] From 01aa4bae809cb54d2d91544102f1023217134853 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 11 May 2021 21:41:54 +0200 Subject: [PATCH 12/20] [#45] Re-ordered tasks to make them logical --- .woodpecker.yml | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 788d3c7..ab5f147 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -11,6 +11,25 @@ pipeline: secrets: [ cache_s3_access_key, cache_s3_secret_key ] + # =====BUILDING===== + build-frontend: + image: node:15-alpine3.13 + pull: true + group: build + commands: + - cd web + - yarn install + - yarn run build + + + build-backend: + image: chewingbever/fej-builder:latest + pull: true + group: build + commands: + - cargo build + + # =====LINTING===== lint-frontend: image: node:15-alpine3.13 @@ -21,27 +40,11 @@ pipeline: lint-backend: image: chewingbever/fej-builder:latest - pull: true group: lint commands: - cargo fmt -- --check - # =====BUILDING===== - build-frontend: - image: node:15-alpine3.13 - commands: - - cd web - - yarn install - - yarn run build - - - build-backend: - image: chewingbever/fej-builder:latest - commands: - - cargo build - - # =====TESTING===== test-backend: image: chewingbever/fej-builder:latest From 728e72e47c7f4f0b6bc03e83b95814e7b24db400 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 11 May 2021 21:51:54 +0200 Subject: [PATCH 13/20] [#45] Removed unnecessary clippy flag (and let's test the cache) --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index ab5f147..b1797e2 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -50,7 +50,7 @@ pipeline: image: chewingbever/fej-builder:latest commands: # This is run here because it requires compilation - - cargo clippy -- --no-deps -D warnings + - cargo clippy -- -D warnings - cargo test From 9dbb4c8804f31b5a557661ec5df0ae2a94463b62 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 11 May 2021 21:58:49 +0200 Subject: [PATCH 14/20] [#45] Moved clippy call to lint phase --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index b1797e2..4d975b8 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -43,14 +43,14 @@ pipeline: group: lint commands: - cargo fmt -- --check + # This is run here because it requires compilation + - cargo clippy -- -D warnings # =====TESTING===== test-backend: image: chewingbever/fej-builder:latest commands: - # This is run here because it requires compilation - - cargo clippy -- -D warnings - cargo test From c8bfc16af8614629556f198485316b008e9df7ad Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 11 May 2021 22:03:44 +0200 Subject: [PATCH 15/20] [#45] Moved tests to before linting --- .woodpecker.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 4d975b8..12ebf7c 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -30,6 +30,13 @@ pipeline: - cargo build + # =====TESTING===== + test-backend: + image: chewingbever/fej-builder:latest + commands: + - cargo test + + # =====LINTING===== lint-frontend: image: node:15-alpine3.13 @@ -45,13 +52,6 @@ pipeline: - cargo fmt -- --check # This is run here because it requires compilation - cargo clippy -- -D warnings - - - # =====TESTING===== - test-backend: - image: chewingbever/fej-builder:latest - commands: - - cargo test # =====REBUILD & FLUSH CACHE===== From faa4f713c86cd82647c4e0ec92c0b7f03b205ba5 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 11 May 2021 22:11:35 +0200 Subject: [PATCH 16/20] [#45] Fixed clippy errors --- src/fej/ivago/pickup_time.rs | 5 +---- src/populate_ivago.rs | 7 +++++-- src/server/main.rs | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/fej/ivago/pickup_time.rs b/src/fej/ivago/pickup_time.rs index f70cbcf..19031fb 100644 --- a/src/fej/ivago/pickup_time.rs +++ b/src/fej/ivago/pickup_time.rs @@ -16,10 +16,7 @@ impl PickupTime { /// * `date` - Date of pickup time /// * `label` - Type of trash pub fn new(date: BasicDate, label: String) -> PickupTime { - PickupTime { - date: date, - label: label, - } + PickupTime { date, label } } } diff --git a/src/populate_ivago.rs b/src/populate_ivago.rs index 9dfc876..0886551 100644 --- a/src/populate_ivago.rs +++ b/src/populate_ivago.rs @@ -8,12 +8,15 @@ fn main() { let database_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set"); let db_conn = PgConnection::establish(&database_url) - .expect(&format!("Error connecting to {}", database_url)); + .unwrap_or_else(|_| panic!("Error connecting to {}", database_url)); // Doing this linearly is good enough I'd say for c in ABC.chars() { if let Ok(streets) = search_streets(&c.to_string()) { - insert_into(ivago_streets).values(streets).execute(&db_conn); + insert_into(ivago_streets) + .values(streets) + .execute(&db_conn) + .expect("Failed to insert rows."); } } } diff --git a/src/server/main.rs b/src/server/main.rs index 2a5bd2f..bfe4fef 100644 --- a/src/server/main.rs +++ b/src/server/main.rs @@ -23,9 +23,9 @@ use rocket_contrib::databases::diesel; #[cfg(feature = "frontend")] use rocket_contrib::serve::StaticFiles; -pub struct CORS; +pub struct Cors; -impl Fairing for CORS { +impl Fairing for Cors { fn info(&self) -> Info { Info { name: "Add CORS headers to responses", @@ -63,8 +63,9 @@ fn run_db_migrations(rocket: Rocket) -> Result { fn rocket() -> rocket::Rocket { // This needs to be muted for the frontend feature + #[allow(unused_mut)] let mut rocket = rocket::ignite() - .attach(CORS) + .attach(Cors) .attach(FejDbConn::fairing()) .attach(AdHoc::on_attach("Database Migrations", run_db_migrations)) .mount("/api/ivago", routes::ivago()) // /api being hardcoded is temporary From b9d0bb7aa5dd3aacb5072a632e6395617e421a6a Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Wed, 12 May 2021 14:12:29 +0200 Subject: [PATCH 17/20] [#45] Removed leftover comments --- .woodpecker.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 12ebf7c..9d59c79 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -21,7 +21,6 @@ pipeline: - yarn install - yarn run build - build-backend: image: chewingbever/fej-builder:latest pull: true @@ -83,26 +82,3 @@ pipeline: # Push the cache, even on failure when: status: [ success, failure ] - - - # publish-builder: - # image: plugins/docker - # repo: chewingbever/fej-builder - # dockerfile: docker/Dockerfile.builder - # tag: [ latest ] - # secrets: [ docker_username, docker_password ] - # when: - # branch: develop - # event: push - - # Backend cicd jobs are disabled until we can figure out a way to cache stuff - # test-backend: - # image: chewingbever/fej-builder:latest - # # Always update the builder image - # pull: true - # commands: - # - cargo test - - # TODO build dev & rel image, deploy these images - -# branches: [ master, develop ] From 2547434d95aa3eaf92524a22967ecd951e86ebb1 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Wed, 12 May 2021 14:28:59 +0200 Subject: [PATCH 18/20] [#45] Added cargo caching; made clippy more strict --- .woodpecker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 9d59c79..726f573 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -50,7 +50,7 @@ pipeline: commands: - cargo fmt -- --check # This is run here because it requires compilation - - cargo clippy -- -D warnings + - cargo clippy --all-targets -- -D warnings # =====REBUILD & FLUSH CACHE===== @@ -62,6 +62,7 @@ pipeline: rebuild: true mount: - target + - .cargo - web/node_modules secrets: [ cache_s3_access_key, cache_s3_secret_key ] From 8baeda4caed02ae32a20b0bf4484d4880ec0b0fb Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Wed, 12 May 2021 14:29:39 +0200 Subject: [PATCH 19/20] [#45] Fixed clippy errors --- src/fej/ivago/street.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/fej/ivago/street.rs b/src/fej/ivago/street.rs index 2f30f06..4ba45cb 100644 --- a/src/fej/ivago/street.rs +++ b/src/fej/ivago/street.rs @@ -18,10 +18,7 @@ impl Street { // This constructor just makes my life a bit easier during testing #[cfg(test)] fn new(name: String, city: String) -> Street { - Street { - name: name, - city: city, - } + Street { name, city } } } From 4cf9152fc4fe49530aa1ce39a84e43e5089cdfd1 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Wed, 12 May 2021 14:44:10 +0200 Subject: [PATCH 20/20] [#45] Hopefully made Cargo home available across steps --- .woodpecker.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 726f573..f670957 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -25,6 +25,8 @@ pipeline: image: chewingbever/fej-builder:latest pull: true group: build + environment: + - CARGO_HOME=.cargo commands: - cargo build @@ -32,6 +34,8 @@ pipeline: # =====TESTING===== test-backend: image: chewingbever/fej-builder:latest + environment: + - CARGO_HOME=.cargo commands: - cargo test @@ -47,6 +51,8 @@ pipeline: lint-backend: image: chewingbever/fej-builder:latest group: lint + environment: + - CARGO_HOME=.cargo commands: - cargo fmt -- --check # This is run here because it requires compilation