You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
torrents-csv-server/.woodpecker.yml

90 lines
2.2 KiB
YAML

# TODO: The when: platform conditionals aren't working currently
# See https://github.com/woodpecker-ci/woodpecker/issues/1677
variables:
- &muslrust_image 'clux/muslrust:stable'
clone:
git:
image: woodpeckerci/plugin-git
settings:
depth: 50
lfs: false
submodule_update_remote: false
recursive: false
pipeline:
prepare_repo:
image: alpine:3
commands:
- apk add git
- git submodule init
- git submodule update --recursive --remote
when:
event: tag
prettier_markdown_check:
image: tmknom/prettier
commands:
- prettier -c *.md
# use minimum supported rust version for most steps
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 ~/.cargo . -r
- rustup toolchain install nightly
- rustup component add rustfmt --toolchain nightly
- cargo +nightly fmt -- --check
cargo_clippy:
image: *muslrust_image
environment:
CARGO_HOME: .cargo
commands:
# latest rust for clippy to get extra checks
# when adding new clippy lints, make sure to also add them in scripts/fix-clippy.sh
- rustup component add clippy
- cargo clippy
# cargo_test:
# image: *muslrust_image
# environment:
# CARGO_HOME: .cargo
# commands:
# - cargo test --no-fail-fast
publish_release_docker_image:
image: woodpeckerci/plugin-docker-buildx
settings:
repo: dessalines/torrents-csv-server
dockerfile: prod/Dockerfile
platforms: linux/amd64
username:
from_secret: docker_username
password:
from_secret: docker_password
auto_tag: true
when:
event: tag
notify_on_failure:
image: alpine:3
commands:
- apk add curl
- "curl -d'CI build failed: ${CI_BUILD_LINK}' ntfy.sh/torrents_csv_ci"
when:
status: [ failure ]
notify_on_tag_deploy:
image: alpine:3
commands:
- apk add curl
- "curl -d'Torrents-csv-server:${CI_COMMIT_TAG} deployed' ntfy.sh/torrents_csv_ci"
when:
event: tag