From 4561d1bcefc04591e5ba62ac9e9a1725d785d2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?c=C4=83t=C4=83lin?= Date: Fri, 12 Aug 2022 17:35:49 +0000 Subject: [PATCH] ci: add base pipeline with deps cache and pre-commit --- .drone.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 19 ---------------- README.md | 1 - 3 files changed, 67 insertions(+), 20 deletions(-) create mode 100644 .drone.yml delete mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..79568cf --- /dev/null +++ b/.drone.yml @@ -0,0 +1,67 @@ +--- +kind: pipeline +type: docker +name: build + +trigger: + ref: + - refs/heads/** + - refs/tags/v* +environment: + REGISTRY_HOST: https://git.roboces.dev + DESTINATION_PREFIX: git.roboces.dev/catalin/halig + PRE_COMMIT_HOME: /drone/src/.cache/.pre-commit + +steps: +- name: restore cache + image: meltwater/drone-cache + pull: true + environment: + AWS_ACCESS_KEY_ID: + from_secret: AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: AWS_SECRET_ACCESS_KEY + settings: + restore: true + bucket: halig-cache + endpoint: https://s3.fukurokuju.dev + region: us-east-1 + path_style: true + mount: + - .venv + - .cache/.pre-commit + +- name: install dependencies + pull: true + image: git.roboces.dev/catalin/poetry:beta + commands: + - poetry config virtualenvs.in-project 1 + - poetry install --with linters + +- name: lint + pull: true + image: git.roboces.dev/catalin/poetry:beta + commands: + - .venv/bin/pre-commit run --all-files --color always + +- name: rebuild cache + image: meltwater/drone-cache + pull: true + environment: + AWS_ACCESS_KEY_ID: + from_secret: AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: AWS_SECRET_ACCESS_KEY + settings: + rebuild: true + path_style: true + bucket: halig-cache + endpoint: https://s3.fukurokuju.dev + region: us-east-1 + mount: + - .venv + - .cache/.pre-commit + when: + status: + - failure + - success diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 2bdfe89..0000000 --- a/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.10-alpine - -RUN apk add --no-cache \ - curl \ - gcc \ - libressl-dev \ - musl-dev \ - libffi-dev \ - && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal \ - && source $HOME/.cargo/env \ - && curl -sSL https://install.python-poetry.org | python3 - --preview \ - && ln -fs /root/.local/bin/poetry /usr/local/bin \ - && rm -rf /root/.rustup \ - && apk del \ - curl \ - gcc \ - libressl-dev \ - musl-dev \ - libffi-dev diff --git a/README.md b/README.md index 9bc62cc..a7f58c6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ # halig -