ci: add base pipeline with deps cache and pre-commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
cătălin 2022-08-12 17:35:49 +00:00
commit 4561d1bcef
3 changed files with 67 additions and 20 deletions

67
.drone.yml Normal file
View file

@ -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

View file

@ -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

View file

@ -1,2 +1 @@
# halig