- git submodule update
prettier_check:
+ group: format
image: tmknom/prettier:3.0.0
commands:
- prettier -c . '!**/volumes' '!**/dist' '!target' '!**/translations'
+ toml_fmt:
+ group: format
+ image: tamasfe/taplo:0.8.1
+ commands:
+ - taplo format --check
+
+ sql_fmt:
+ group: format
+ image: backplane/pgformatter:latest
+ commands:
+ - ./scripts/sql_format_check.sh
+
+ cargo_fmt:
+ group: format
+ image: *muslrust_image
+ environment:
+ # store cargo data in repo folder so that it gets cached between steps
+ CARGO_HOME: .cargo
+ commands:
+ # need make existing toolchain available
+ - cp -n ~/.cargo . -r
+ - rustup toolchain install nightly-2023-07-10 --no-self-update --profile minimal --component rustfmt
+ - cargo +nightly-2023-07-10 fmt -- --check
+
restore-cache:
image: meltwater/drone-cache:v1
pull: true
[MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET]
when: *slow_check_paths
- toml_fmt:
- image: tamasfe/taplo:0.8.1
- commands:
- - taplo format --check
-
- cargo_fmt:
- image: *muslrust_image
- environment:
- # store cargo data in repo folder so that it gets cached between steps
- CARGO_HOME: .cargo
- commands:
- # need make existing toolchain available
- - cp -n ~/.cargo . -r
- - rustup toolchain install nightly-2023-07-10
- - rustup component add rustfmt --toolchain nightly-2023-07-10
- - cargo +nightly-2023-07-10 fmt -- --check
-
# make sure api builds with default features (used by other crates relying on lemmy api)
check_api_common_default_features:
image: *muslrust_image
environment:
CARGO_HOME: .cargo
commands:
- # when adding new clippy lints, make sure to also add them in scripts/fix-clippy.sh
+ # when adding new clippy lints, make sure to also add them in scripts/lint.sh
- rustup component add clippy
- cargo clippy --workspace --tests --all-targets --features console --
-D warnings -D deprecated -D clippy::perf -D clippy::complexity
-D clippy::indexing_slicing
when: *slow_check_paths
- cargo_test:
+ cargo_build:
image: *muslrust_image
environment:
- LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
- RUST_BACKTRACE: "1"
CARGO_HOME: .cargo
commands:
- - export LEMMY_CONFIG_LOCATION=../../config/config.hjson
- - cargo test --workspace --no-fail-fast
+ - cargo build
+ - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
when: *slow_check_paths
- cargo_build:
+ cargo_test:
+ group: tests
image: *muslrust_image
environment:
+ LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
+ RUST_BACKTRACE: "1"
CARGO_HOME: .cargo
commands:
- - cargo build
- - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
+ - export LEMMY_CONFIG_LOCATION=../../config/config.hjson
+ - cargo test --workspace --no-fail-fast
when: *slow_check_paths
run_federation_tests:
+ group: tests
image: node:alpine
environment:
LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
- "api_tests/node_modules"
secrets:
[MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET]
- when: *slow_check_paths
+ when:
+ - event: push
+ branch: main
publish_release_docker:
image: woodpeckerci/plugin-docker-buildx