From 1a40bd0355cb4f38204be7ce2c8f7d0183898199 Mon Sep 17 00:00:00 2001 From: "Aode (lion)" Date: Thu, 30 Dec 2021 12:08:38 -0600 Subject: [PATCH] Add drone --- .drone.yml | 307 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 307 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..bd28079 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,307 @@ +kind: pipeline +type: docker +name: clippy + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: clippy + image: asonix/rust-builder:latest-linux-amd64 + pull: always + commands: + - rustup component add clippy + - cargo clippy -- -D warnings + - cargo clippy --example fetch -- -D warnings + - cargo clippy --example resolver -- -D warnings + +trigger: + event: + - tag + - push + - pull_request + +--- + +kind: pipeline +type: docker +name: tests + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: tests + image: asonix/rust-builder:latest-linux-amd64 + pull: always + commands: + - cargo test + +trigger: + event: + - tag + - push + - pull_request + +--- + +kind: pipeline +type: docker +name: check-amd64 + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: build + image: asonix/rust-builder:latest-linux-amd64 + pull: always + commands: + - cargo check --target=$TARGET + - cargo check --target=$TARGET --example fetch + - cargo check --target=$TARGET --example resolver + +trigger: + event: + - push + - pull_request + +--- + +kind: pipeline +type: docker +name: check-arm64v8 + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: build + image: asonix/rust-builder:latest-linux-arm64v8 + pull: always + commands: + - cargo check --target=$TARGET + - cargo check --target=$TARGET --example fetch + - cargo check --target=$TARGET --example resolver + +trigger: + event: + - push + - pull_request + +--- + +kind: pipeline +type: docker +name: check-arm32v7 + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: build + image: asonix/rust-builder:latest-linux-arm32v7 + pull: always + commands: + - cargo check --target=$TARGET + - cargo check --target=$TARGET --example fetch + - cargo check --target=$TARGET --example resolver + +trigger: + event: + - push + - pull_request +--- + +kind: pipeline +type: docker +name: build-amd64 + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: build + image: asonix/rust-builder:latest-linux-amd64 + pull: always + commands: + - cargo build --target=$TARGET + - cargo build --target=$TARGET --example fetch + - cargo build --target=$TARGET --example resolver + +trigger: + event: + - tag + +--- + +kind: pipeline +type: docker +name: build-arm64v8 + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: build + image: asonix/rust-builder:latest-linux-arm64v8 + pull: always + commands: + - cargo build --target=$TARGET + - cargo build --target=$TARGET --example fetch + - cargo build --target=$TARGET --example resolver + +trigger: + event: + - tag + +--- + +kind: pipeline +type: docker +name: build-arm32v7 + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: build + image: asonix/rust-builder:latest-linux-arm32v7 + pull: always + commands: + - cargo build --target=$TARGET + - cargo build --target=$TARGET --example fetch + - cargo build --target=$TARGET --example resolver + +trigger: + event: + - tag + +--- + +kind: pipeline +type: docker +name: publish-crate + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: publish + image: asonix/rust-builder:latest-linux-amd64 + pull: always + environment: + CRATES_IO_TOKEN: + from_secret: crates_io_token + commands: + - cargo publish --token $CRATES_IO_TOKEN + +depends_on: +- clippy +- tests +- build-amd64 +- build-arm64v8 +- build-arm32v7 + +trigger: + event: + - tag