2021-06-19 12:14:57 +02:00
|
|
|
pipeline:
|
|
|
|
# Download the cache from S3
|
|
|
|
restore-cache:
|
|
|
|
image: plugins/s3-cache
|
|
|
|
pull: true
|
|
|
|
|
|
|
|
endpoint: https://s3.roosens.me
|
|
|
|
root: build-cache/
|
|
|
|
restore: true
|
|
|
|
|
|
|
|
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:
|
2021-06-25 11:32:50 +02:00
|
|
|
- apk add musl-dev postgresql-dev
|
2021-06-19 12:14:57 +02:00
|
|
|
- cargo build
|
|
|
|
|
|
|
|
|
|
|
|
# =====TESTING=====
|
|
|
|
test-backend:
|
|
|
|
image: rust:1.53-alpine
|
|
|
|
environment:
|
|
|
|
- CARGO_HOME=.cargo
|
|
|
|
commands:
|
2021-06-25 11:32:50 +02:00
|
|
|
- apk add musl-dev postgresql-dev
|
2021-06-19 12:14:57 +02:00
|
|
|
- cargo test
|
|
|
|
|
|
|
|
|
|
|
|
# =====LINTING=====
|
|
|
|
lint-backend:
|
|
|
|
image: rust:1.53-alpine
|
|
|
|
group: lint
|
|
|
|
environment:
|
|
|
|
- CARGO_HOME=.cargo
|
|
|
|
commands:
|
2021-06-25 11:32:50 +02:00
|
|
|
- apk add musl-dev postgresql-dev
|
2021-06-25 11:37:45 +02:00
|
|
|
- rustup component add rustfmt clippy
|
2021-06-19 12:14:57 +02:00
|
|
|
- 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
|
|
|
|
|
|
|
|
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 ]
|
|
|
|
|
|
|
|
flush-cache:
|
|
|
|
image: plugins/s3-cache
|
|
|
|
|
|
|
|
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 ]
|