summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml121
1 files changed, 58 insertions, 63 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ff3308e31..dab52e4c6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,12 +1,13 @@
image: git.pleroma.social:5050/pleroma/pleroma/ci-base
variables: &global_variables
+ # Only used for the release
ELIXIR_VER: 1.12.3
POSTGRES_DB: pleroma_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DB_HOST: postgres
- DB_PORT: 5432
+ DB_PORT: "5432"
MIX_ENV: test
workflow:
@@ -25,9 +26,10 @@ cache: &global_cache_policy
- _build
stages:
- - check-changelog
- build
+ - lint
- test
+ - check-changelog
- benchmark
- deploy
- release
@@ -70,7 +72,7 @@ check-changelog:
tags:
- amd64
-build:
+build-1.12.3:
extends:
- .build_changes_policy
- .using-ci-base
@@ -78,10 +80,20 @@ build:
script:
- mix compile --force
+build-1.15.7-otp-25:
+ extends:
+ - .build_changes_policy
+ - .using-ci-base
+ stage: build
+ image: git.pleroma.social:5050/pleroma/pleroma/ci-base:elixir-1.15
+ allow_failure: true
+ script:
+ - mix compile --force
+
spec-build:
extends:
- .using-ci-base
- stage: test
+ stage: build
rules:
- changes:
- ".gitlab-ci.yml"
@@ -101,7 +113,7 @@ benchmark:
variables:
MIX_ENV: benchmark
services:
- - name: postgres:9.6-alpine
+ - name: postgres:11.22-alpine
alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
script:
@@ -109,7 +121,7 @@ benchmark:
- mix ecto.migrate
- mix pleroma.load_testing
-unit-testing:
+unit-testing-1.12.3:
extends:
- .build_changes_policy
- .using-ci-base
@@ -117,12 +129,11 @@ unit-testing:
cache: &testing_cache_policy
<<: *global_cache_policy
policy: pull
-
- services:
+ services: &testing_services
- name: postgres:13-alpine
alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- script:
+ script: &testing_script
- mix ecto.create
- mix ecto.migrate
- mix test --cover --preload-modules
@@ -133,65 +144,35 @@ unit-testing:
coverage_format: cobertura
path: coverage.xml
-unit-testing-erratic:
+unit-testing-1.15.7-otp-25:
extends:
- .build_changes_policy
- .using-ci-base
stage: test
- retry: 2
+ image: git.pleroma.social:5050/pleroma/pleroma/ci-base:elixir-1.15-otp25
allow_failure: true
- cache: &testing_cache_policy
- <<: *global_cache_policy
- policy: pull
-
- services:
- - name: postgres:13-alpine
- alias: postgres
- command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- script:
- - mix ecto.create
- - mix ecto.migrate
- - mix test --only=erratic
+ cache: *testing_cache_policy
+ services: *testing_services
+ script: *testing_script
-# Removed to fix CI issue. In this early state it wasn't adding much value anyway.
-# TODO Fix and reinstate federated testing
-# federated-testing:
-# stage: test
-# cache: *testing_cache_policy
-# services:
-# - name: minibikini/postgres-with-rum:12
-# alias: postgres
-# command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
-# script:
-# - mix deps.get
-# - mix ecto.create
-# - mix ecto.migrate
-# - epmd -daemon
-# - mix test --trace --only federated
-
-unit-testing-rum:
+unit-testing-1.12-erratic:
extends:
- .build_changes_policy
- .using-ci-base
stage: test
+ retry: 2
+ allow_failure: true
cache: *testing_cache_policy
- services:
- - name: minibikini/postgres-with-rum:12
- alias: postgres
- command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- variables:
- <<: *global_variables
- RUM_ENABLED: "true"
+ services: *testing_services
script:
- mix ecto.create
- mix ecto.migrate
- - "mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
- - mix test --preload-modules
+ - mix test --only=erratic
-lint:
+formatting-1.13:
extends: .build_changes_policy
- image: &current_elixir elixir:1.12-alpine
- stage: test
+ image: &formatting_elixir elixir:1.13-alpine
+ stage: lint
cache: *testing_cache_policy
before_script: &current_bfr_script
- apk update
@@ -202,24 +183,37 @@ lint:
script:
- mix format --check-formatted
+cycles-1.13:
+ extends: .build_changes_policy
+ image: *formatting_elixir
+ stage: lint
+ cache: {}
+ before_script: *current_bfr_script
+ script:
+ - mix compile
+ - mix xref graph --format cycles --label compile | awk '{print $0} END{exit ($0 != "No cycles found")}'
+
analysis:
extends:
- .build_changes_policy
- .using-ci-base
- stage: test
+ stage: lint
cache: *testing_cache_policy
script:
- mix credo --strict --only=warnings,todo,fixme,consistency,readability
-cycles:
- extends: .build_changes_policy
- image: *current_elixir
- stage: test
- cache: {}
- before_script: *current_bfr_script
+dialyzer:
+ extends:
+ - .build_changes_policy
+ - .using-ci-base
+ stage: lint
+ allow_failure: true
+ when: manual
+ cache: *testing_cache_policy
+ tags:
+ - feld
script:
- - mix compile
- - mix xref graph --format cycles --label compile | awk '{print $0} END{exit ($0 != "No cycles found")}'
+ - mix dialyzer
docs-deploy:
stage: deploy
@@ -319,8 +313,9 @@ amd64:
- deps
variables: &release-variables
MIX_ENV: prod
+ VIX_COMPILATION_MODE: PLATFORM_PROVIDED_LIBVIPS
before_script: &before-release
- - apt-get update && apt-get install -y cmake libmagic-dev
+ - apt-get update && apt-get install -y cmake libmagic-dev libvips-dev erlang-dev
- echo "import Config" > config/prod.secret.exs
- mix local.hex --force
- mix local.rebar --force
@@ -341,7 +336,7 @@ amd64-musl:
cache: *release-cache
variables: *release-variables
before_script: &before-release-musl
- - apk add git build-base cmake file-dev openssl
+ - apk add git build-base cmake file-dev openssl vips-dev
- echo "import Config" > config/prod.secret.exs
- mix local.hex --force
- mix local.rebar --force