Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix & Optimize CI config #2802

Merged
merged 4 commits into from
Apr 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions .woodpecker.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# TODO: The when: platform conditionals aren't working currently
# See https://github.com/woodpecker-ci/woodpecker/issues/1677

variables:
6543 marked this conversation as resolved.
Show resolved Hide resolved
- &muslrust_image 'clux/muslrust:1.67.0'

clone:
git:
image: woodpeckerci/plugin-git
settings:
6543 marked this conversation as resolved.
Show resolved Hide resolved
recursive: true
submodule_update_remote: true

pipeline:
# use minimum supported rust version for most steps
prepare_repo:
image: alpine:3
commands:
- apk add git
#- git fetch --tags
- git submodule init
- git submodule update --recursive --remote

cargo_fmt:
image: clux/muslrust:1.67.0
image: *muslrust_image
environment:
# store cargo data in repo folder so that it gets cached between steps
CARGO_HOME: .cargo
Expand All @@ -28,7 +30,7 @@ pipeline:
# check each package to make sure they compile with default features.
# this is required for crates.io
cargo_check:
image: clux/muslrust:1.67.0
image: *muslrust_image
environment:
CARGO_HOME: .cargo
commands:
Expand All @@ -50,7 +52,7 @@ pipeline:
# platform: linux/amd64

cargo_clippy:
image: clux/muslrust:1.67.0
image: *muslrust_image
environment:
CARGO_HOME: .cargo
commands:
Expand All @@ -74,7 +76,7 @@ pipeline:
# platform: linux/amd64

lemmy_api_common_doesnt_depend_on_diesel:
image: clux/muslrust:1.67.0
image: *muslrust_image
environment:
CARGO_HOME: .cargo
commands:
Expand All @@ -83,7 +85,7 @@ pipeline:
# platform: linux/amd64

check_defaults_hjson_updated:
image: clux/muslrust:1.67.0
image: *muslrust_image
environment:
CARGO_HOME: .cargo
commands:
Expand All @@ -94,7 +96,7 @@ pipeline:
# platform: linux/amd64

cargo_test:
image: clux/muslrust:1.67.0
image: *muslrust_image
environment:
LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
RUST_BACKTRACE: "1"
Expand All @@ -107,7 +109,7 @@ pipeline:
# platform: linux/amd64

cargo_build:
image: clux/muslrust:1.67.0
image: *muslrust_image
environment:
CARGO_HOME: .cargo
commands:
Expand Down Expand Up @@ -216,11 +218,11 @@ pipeline:

# using https://github.com/pksunkara/cargo-workspaces
publish_to_crates_io:
image: clux/muslrust:1.67.0
image: *muslrust_image
commands:
- cargo install cargo-workspaces
- cp -r migrations crates/db_schema/
- cargo login "$CARGO_TOKEN"
- cargo login "$CARGO_API_TOKEN"
6543 marked this conversation as resolved.
Show resolved Hide resolved
- cargo workspaces publish --from-git --allow-dirty --no-verify --allow-branch "${CI_COMMIT_TAG}" --yes custom "${CI_COMMIT_TAG}"
secrets: [cargo_api_token]
when:
Expand Down