use when path include

This commit is contained in:
Felix Ableitner 2023-08-01 11:15:02 +02:00
parent 5ee42d8b50
commit d794329282

View file

@ -3,6 +3,7 @@
variables: variables:
- &muslrust_image "clux/muslrust:1.70.0" - &muslrust_image "clux/muslrust:1.70.0"
- &slow_check_paths ["crates", "src", "Cargo.toml", "migrations", "api_tests"]
# Broken for cron jobs currently, see # Broken for cron jobs currently, see
# https://github.com/woodpecker-ci/woodpecker/issues/1716 # https://github.com/woodpecker-ci/woodpecker/issues/1716
@ -49,7 +50,8 @@ pipeline:
secrets: secrets:
[MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET] [MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET]
when: when:
path: ["crates", "src", "Cargo.toml", "migrations", "api_tests"] path:
include: *slow_check_paths
toml_fmt: toml_fmt:
image: tamasfe/taplo:0.8.1 image: tamasfe/taplo:0.8.1
@ -76,7 +78,8 @@ pipeline:
commands: commands:
- cargo check --package lemmy_api_common - cargo check --package lemmy_api_common
when: when:
path: ["crates", "src", "Cargo.toml", "migrations"] path:
include: *slow_check_paths
lemmy_api_common_doesnt_depend_on_diesel: lemmy_api_common_doesnt_depend_on_diesel:
image: *muslrust_image image: *muslrust_image
@ -85,7 +88,8 @@ pipeline:
commands: commands:
- "! cargo tree -p lemmy_api_common --no-default-features -i diesel" - "! cargo tree -p lemmy_api_common --no-default-features -i diesel"
when: when:
path: ["crates", "src", "Cargo.toml", "migrations"] path:
include: *slow_check_paths
lemmy_api_common_works_with_wasm: lemmy_api_common_works_with_wasm:
image: *muslrust_image image: *muslrust_image
@ -95,7 +99,8 @@ pipeline:
- "rustup target add wasm32-unknown-unknown" - "rustup target add wasm32-unknown-unknown"
- "cargo check --target wasm32-unknown-unknown -p lemmy_api_common" - "cargo check --target wasm32-unknown-unknown -p lemmy_api_common"
when: when:
path: ["crates", "src", "Cargo.toml", "migrations"] path:
include: *slow_check_paths
check_defaults_hjson_updated: check_defaults_hjson_updated:
image: *muslrust_image image: *muslrust_image
@ -106,7 +111,8 @@ pipeline:
- ./scripts/update_config_defaults.sh config/defaults_current.hjson - ./scripts/update_config_defaults.sh config/defaults_current.hjson
- diff config/defaults.hjson config/defaults_current.hjson - diff config/defaults.hjson config/defaults_current.hjson
when: when:
path: ["crates", "src", "Cargo.toml", "migrations"] path:
include: *slow_check_paths
check_diesel_schema: check_diesel_schema:
image: willsquire/diesel-cli image: willsquire/diesel-cli
@ -118,7 +124,8 @@ pipeline:
- diesel print-schema --config-file=diesel.toml > tmp.schema - diesel print-schema --config-file=diesel.toml > tmp.schema
- diff tmp.schema crates/db_schema/src/schema.rs - diff tmp.schema crates/db_schema/src/schema.rs
when: when:
path: ["crates", "src", "Cargo.toml", "migrations"] path:
include: *slow_check_paths
check_diesel_migration_revertable: check_diesel_migration_revertable:
image: willsquire/diesel-cli image: willsquire/diesel-cli
@ -129,7 +136,8 @@ pipeline:
- diesel migration run - diesel migration run
- diesel migration redo - diesel migration redo
when: when:
path: ["crates", "src", "Cargo.toml", "migrations"] path:
include: *slow_check_paths
cargo_clippy: cargo_clippy:
image: *muslrust_image image: *muslrust_image
@ -154,7 +162,8 @@ pipeline:
-D clippy::unwrap_used -D clippy::unwrap_used
-D clippy::indexing_slicing -D clippy::indexing_slicing
when: when:
path: ["crates", "src", "Cargo.toml", "migrations"] path:
include: *slow_check_paths
cargo_test: cargo_test:
image: *muslrust_image image: *muslrust_image
@ -166,7 +175,8 @@ pipeline:
- export LEMMY_CONFIG_LOCATION=../../config/config.hjson - export LEMMY_CONFIG_LOCATION=../../config/config.hjson
- cargo test --workspace --no-fail-fast - cargo test --workspace --no-fail-fast
when: when:
path: ["crates", "src", "Cargo.toml", "migrations"] path:
include: *slow_check_paths
cargo_build: cargo_build:
image: *muslrust_image image: *muslrust_image
@ -176,7 +186,8 @@ pipeline:
- cargo build - cargo build
- mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
when: when:
path: ["crates", "src", "Cargo.toml", "migrations", "api_tests"] path:
include: *slow_check_paths
run_federation_tests: run_federation_tests:
image: node:alpine image: node:alpine
@ -190,7 +201,8 @@ pipeline:
- yarn - yarn
- yarn api-test - yarn api-test
when: when:
path: ["crates", "src", "Cargo.toml", "migrations", "api_tests"] path:
include: *slow_check_paths
rebuild-cache: rebuild-cache:
image: meltwater/drone-cache:v1 image: meltwater/drone-cache:v1
@ -215,7 +227,8 @@ pipeline:
secrets: secrets:
[MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET] [MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET]
when: when:
path: ["crates", "src", "Cargo.toml", "migrations", "api_tests"] path:
include: *slow_check_paths
publish_release_docker: publish_release_docker:
image: woodpeckerci/plugin-docker-buildx image: woodpeckerci/plugin-docker-buildx