diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ecfd732 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = false +indent_size = 4 + +[*.{yml,yaml}] +indent_size = 2 diff --git a/.gitignore b/.gitignore index 7a184b0..e9d365b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ target/ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -# Cargo.lock +Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk diff --git a/.woodpecker.yml b/.woodpecker.yml index 49e99a8..cb88ba5 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,77 +1,77 @@ pipeline: - # Download the cache from S3 - restore-cache: - image: plugins/s3-cache - pull: true + # Download the cache from S3 + restore-cache: + image: plugins/s3-cache + pull: true - endpoint: https://s3.roosens.me - root: build-cache/ - restore: true + endpoint: https://s3.roosens.me + root: build-cache/ + restore: true - secrets: [ cache_s3_access_key, cache_s3_secret_key ] + secrets: [ cache_s3_access_key, cache_s3_secret_key ] - # =====BUILDING===== - build-backend: - image: rust:1.53-alpine - pull: true - group: build - environment: - - CARGO_HOME=.cargo - commands: - - apk add musl-dev postgresql-dev - - cargo build + # =====BUILDING===== + build-backend: + image: rust:1.53-alpine + pull: true + group: build + environment: + - CARGO_HOME=.cargo + commands: + - apk add musl-dev postgresql-dev + - cargo build - # =====TESTING===== - test-backend: - image: rust:1.53-alpine - environment: - - CARGO_HOME=.cargo - commands: - - apk add musl-dev postgresql-dev - - cargo test + # =====TESTING===== + test-backend: + image: rust:1.53-alpine + environment: + - CARGO_HOME=.cargo + commands: + - apk add musl-dev postgresql-dev + - cargo test - # =====LINTING===== - lint-backend: - image: rust:1.53-alpine - group: lint - environment: - - CARGO_HOME=.cargo - commands: - - apk add musl-dev postgresql-dev - - rustup component add rustfmt clippy - - cargo fmt -- --check - # This is run here because it requires compilation - - cargo clippy --all-targets -- -D warnings - + # =====LINTING===== + lint-backend: + image: rust:1.53-alpine + group: lint + environment: + - CARGO_HOME=.cargo + commands: + - apk add musl-dev postgresql-dev + - rustup component add rustfmt clippy + - cargo fmt -- --check + # This is run here because it requires compilation + - cargo clippy --all-targets -- -D warnings + - # =====REBUILD & FLUSH CACHE===== - rebuild-cache: - image: plugins/s3-cache + # =====REBUILD & FLUSH CACHE===== + rebuild-cache: + image: plugins/s3-cache - endpoint: https://s3.roosens.me - root: build-cache/ - rebuild: true - mount: - - target - - .cargo + endpoint: https://s3.roosens.me + root: build-cache/ + rebuild: true + mount: + - target + - .cargo - secrets: [ cache_s3_access_key, cache_s3_secret_key ] - # Push the cache, even on failure - when: - status: [ success, failure ] + secrets: [ cache_s3_access_key, cache_s3_secret_key ] + # Push the cache, even on failure + when: + status: [ success, failure ] - flush-cache: - image: plugins/s3-cache + flush-cache: + image: plugins/s3-cache - endpoint: https://s3.roosens.me - root: build-cache/ - flush: true - flush_age: 14 + endpoint: https://s3.roosens.me + root: build-cache/ + flush: true + flush_age: 14 - secrets: [ cache_s3_access_key, cache_s3_secret_key ] - # Push the cache, even on failure - when: - status: [ success, failure ] + secrets: [ cache_s3_access_key, cache_s3_secret_key ] + # Push the cache, even on failure + when: + status: [ success, failure ]