outrun/.drone.yml
James Harton 6d33de49a5
All checks were successful
continuous-integration/drone/push Build is passing
chore: Update forgejo hostname.
2024-02-05 15:35:29 +13:00

136 lines
3 KiB
YAML

kind: pipeline
type: docker
name: build
steps:
- name: restore ASDF cache
image: meltwater/drone-cache
pull: "always"
environment:
AWS_ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
AWS_PLUGIN_PATH_STYLE: true
settings:
restore: true
endpoint:
from_secret: S3_ENDPOINT
bucket:
from_secret: CACHE_BUCKET
region: us-east-1
path-style: true
cache_key: 'asdf-{{ os }}-{{ arch }}-{{ checksum ".tool-versions" }}'
mount:
- .asdf
- name: restore build cache
image: meltwater/drone-cache
pull: "always"
environment:
AWS_ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
AWS_PLUGIN_PATH_STYLE: true
settings:
restore: true
endpoint:
from_secret: S3_ENDPOINT
bucket:
from_secret: CACHE_BUCKET
region: us-east-1
path-style: true
cache_key: 'rust-{{ checksum "Cargo.lock" }}-{{ checksum ".tool-versions" }}'
mount:
- .cargo
- target
- name: build
image: harton.dev/james/asdf_container:latest
pull: "always"
environment:
CARGO_HOME: /drone/src/.cargo
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- restore ASDF cache
- restore build cache
commands:
- asdf_install
- rm -rf .asdf/downloads
- asdf cargo test --no-run --release
- name: store ASDF cache
image: meltwater/drone-cache
pull: "always"
environment:
AWS_ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
AWS_PLUGIN_PATH_STYLE: true
depends_on:
- build
settings:
rebuild: true
override: false
endpoint:
from_secret: S3_ENDPOINT
bucket:
from_secret: CACHE_BUCKET
region: us-east-1
path-style: true
cache_key: 'asdf-{{ os }}-{{ arch }}-{{ checksum ".tool-versions" }}'
mount:
- .asdf
- name: store build cache
image: meltwater/drone-cache
pull: "always"
environment:
AWS_ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
AWS_PLUGIN_PATH_STYLE: true
depends_on:
- build
settings:
rebuild: true
override: false
endpoint:
from_secret: S3_ENDPOINT
bucket:
from_secret: CACHE_BUCKET
region: us-east-1
path-style: true
cache_key: 'rust-{{ checksum "Cargo.lock" }}-{{ checksum ".tool-versions" }}'
mount:
- .cargo
- target
- name: cargo test
image: harton.dev/james/asdf_container:latest
pull: "always"
environment:
CARGO_HOME: /drone/src/.cargo
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- build
commands:
- asdf rustc --version
- asdf cargo --version
- asdf cargo test --jobs 1 --release
- name: cargo clippy
image: harton.dev/james/asdf_container:latest
pull: "always"
environment:
CARGO_HOME: /drone/src/.cargo
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- build
commands:
- asdf rustup component add clippy
- asdf cargo clippy --all-targets --all-features -- -D warnings