chore(CI): Switch to Drone CI.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
James Harton 2023-07-21 16:16:59 +12:00
parent 9d7dd5f7cd
commit 7429ed4c25
Signed by: james
GPG key ID: 90E82DAA13F624F4
3 changed files with 192 additions and 64 deletions

191
.drone.yml Normal file
View file

@ -0,0 +1,191 @@
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: code.harton.nz/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
---
kind: pipeline
type: docker
name: test
depends_on:
- 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: cargo test
image: code.harton.nz/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 rustc --version
- asdf cargo --version
- asdf cargo test --jobs 1 --release
- name: cargo clippy
image: code.harton.nz/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 rustup component add clippy
- asdf cargo clippy --all-targets --all-features -- -D warnings

View file

@ -1,62 +0,0 @@
image: rust:latest
stages:
- dependencies
- test
- release
build:
stage: dependencies
cache:
key: "$CI_JOB_NAME"
paths:
- $HOME/.cargo
- target/
artifacts:
paths:
- $HOME/.cargo
- target/
expire_in: 60 mins
script:
- cargo test --no-run --release
cargo test:
stage: test
dependencies:
- build
script:
- rustc --version && cargo --version
- cargo test --jobs 1 --release
cargo clippy:
stage: test
dependencies:
- build
before_script:
- rustup component add clippy
script:
- cargo clippy --all-targets --all-features -- -D warnings
# cargo publish:
# stage: release
# dependencies:
# - build
# only:
# - /^v[0-9]+\.[0-9]+\.[0-9]+$/
# except:
# - branches
# script:
# - cargo publish --token $CARGO_TOKEN
pages:
stage: release
image: docker:stable
variables:
GIT_SUBMODULE_STRATEGY: recursive
services:
- docker:dind
script:
- docker run -u "$(id -u):$(id -g)" -v $PWD:/app --workdir /app ghcr.io/getzola/zola:v0.16.0 --root outrun-site/ build --output-dir public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH

View file

@ -1,8 +1,7 @@
[![Hippocratic License HL3-FULL](https://img.shields.io/static/v1?label=Hippocratic%20License&message=HL3-FULL&labelColor=5e2751&color=bc8c3d)](https://firstdonoharm.dev/version/3/0/full.html)
[![Build Status](https://img.shields.io/gitlab/pipeline-status/jimsy/outrun?branch=main)](https://gitlab.com/jimsy/outrun/-/pipelines)
[![Build Status](https://drone.harton.nz/api/badges/james/outrun/status.svg?ref=refs/heads/main)](https://drone.harton.nz/james/outrun)
[![Issues](https://img.shields.io/gitlab/issues/open/jimsy/outrun)](https://gitlab.com/jimsy/outrun/-/issues)
# 🌅 Outrun
The most retro-futuristic toy language in the world.