From ff8922f2922bc490d0b9fe236fbda1e0c2ad1dfc Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Fri, 10 Jun 2022 13:37:41 +0100 Subject: [PATCH] Add CI --- .woodpecker/.lint.yml | 9 ++++++++ .woodpecker/.test.yml | 54 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .woodpecker/.lint.yml create mode 100644 .woodpecker/.test.yml diff --git a/.woodpecker/.lint.yml b/.woodpecker/.lint.yml new file mode 100644 index 000000000..615cd7a45 --- /dev/null +++ b/.woodpecker/.lint.yml @@ -0,0 +1,9 @@ +pipeline: + lint: + image: pleromaforkci/ci-base:1.13 + commands: + - mix local.hex --force + - mix local.rebar --force + - mix format --check-formatted + when: + event: [push, tag, deployment] diff --git a/.woodpecker/.test.yml b/.woodpecker/.test.yml new file mode 100644 index 000000000..e9d7f88b1 --- /dev/null +++ b/.woodpecker/.test.yml @@ -0,0 +1,54 @@ +depends_on: +- lint + +matrix: + ELIXIR_VERSION: + - 1.10 + - 1.13 + +pipeline: + build: + image: pleromaforkci/ci-base:${ELIXIR_VERSION} + environment: + MIX_ENV: test + commands: + - cp config/test.ci.exs config/test.secret.exs + - mix local.hex --force + - mix local.rebar --force + - mix deps.get + - mix compile + + analyse: + group: test + image: pleromaforkci/ci-base:${ELIXIR_VERSION} + environment: + MIX_ENV: test + commands: + - mix local.hex --force + - mix local.rebar --force + - mix credo --strict --only=warnings,todo,fixme,consistency,readability + + test: + group: test + image: pleromaforkci/ci-base:${ELIXIR_VERSION} + environment: + MIX_ENV: test + POSTGRES_DB: pleroma_test + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + DB_HOST: postgres + commands: + - mix local.hex --force + - mix local.rebar --force + - mix ecto.drop -f -q + - mix ecto.create + - mix ecto.migrate + - mix test --preload-modules --exclude erratic --exclude federated --max-cases 4 + +services: + postgres: + image: postgres:13 + environment: + POSTGRES_DB: pleroma_test + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres