Refactor CI build (#80)
[akkoma] / .woodpecker / .test.yml
index 49681a3bb1f769a8aad91f8178ece35d1cafd311..f4165502981fd05096af4419c31930b7d2d5026f 100644 (file)
@@ -1,13 +1,23 @@
-depends_on:
-- lint
-
 matrix:
   ELIXIR_VERSION:
   - 1.13
 
 pipeline:
+  lint:
+    when:
+      event:
+      - pull_request
+    image: pleromaforkci/ci-base:1.13
+    commands:
+    - mix local.hex --force
+    - mix local.rebar --force
+    - mix format --check-formatted
+
   build:
     image: pleromaforkci/ci-base:${ELIXIR_VERSION}
+    when:
+      event:
+      - pull_request
     environment:
       MIX_ENV: test
     commands:
@@ -19,6 +29,9 @@ pipeline:
   test:
     group: test
     image: pleromaforkci/ci-base:${ELIXIR_VERSION}
+    when:
+      event:
+      - pull_request
     environment:
       MIX_ENV: test
       POSTGRES_DB: pleroma_test
@@ -28,6 +41,7 @@ pipeline:
     commands:
     - mix local.hex --force
     - mix local.rebar --force
+    - mix deps.get
     - mix ecto.drop -f -q
     - mix ecto.create
     - mix ecto.migrate
@@ -36,6 +50,9 @@ pipeline:
 services:
   postgres:
     image: postgres:13
+    when:
+      event:
+      - pull_request
     environment:
       POSTGRES_DB: pleroma_test
       POSTGRES_USER: postgres