summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml86
1 files changed, 39 insertions, 47 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e5664da68..8b0381d11 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,6 +5,7 @@ variables: &global_variables
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DB_HOST: postgres
+ DB_PORT: 5432
MIX_ENV: test
cache: &global_cache_policy
@@ -34,7 +35,8 @@ after_script:
build:
stage: build
only:
- changes:
+ changes: &build_changes_policy
+ - ".gitlab-ci.yml"
- "**/*.ex"
- "**/*.exs"
- "mix.lock"
@@ -45,6 +47,7 @@ spec-build:
stage: test
only:
changes:
+ - ".gitlab-ci.yml"
- "lib/pleroma/web/api_spec/**/*.ex"
- "lib/pleroma/web/api_spec.ex"
artifacts:
@@ -59,7 +62,7 @@ benchmark:
variables:
MIX_ENV: benchmark
services:
- - name: postgres:9.6
+ - name: postgres:9.6-alpine
alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
script:
@@ -70,38 +73,38 @@ benchmark:
unit-testing:
stage: test
only:
- changes:
- - "**/*.ex"
- - "**/*.exs"
- - "mix.lock"
+ changes: *build_changes_policy
cache: &testing_cache_policy
<<: *global_cache_policy
policy: pull
services:
- - name: postgres:13
+ - 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 coveralls --preload-modules
+ - mix test --cover --preload-modules
+ coverage: '/^Line total: ([^ ]*%)$/'
+ artifacts:
+ reports:
+ coverage_report:
+ coverage_format: cobertura
+ path: coverage.xml
unit-testing-erratic:
stage: test
retry: 2
allow_failure: true
only:
- changes:
- - "**/*.ex"
- - "**/*.exs"
- - "mix.lock"
+ changes: *build_changes_policy
cache: &testing_cache_policy
<<: *global_cache_policy
policy: pull
services:
- - name: postgres:13
+ - name: postgres:13-alpine
alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
script:
@@ -128,10 +131,7 @@ unit-testing-erratic:
unit-testing-rum:
stage: test
only:
- changes:
- - "**/*.ex"
- - "**/*.exs"
- - "mix.lock"
+ changes: *build_changes_policy
cache: *testing_cache_policy
services:
- name: minibikini/postgres-with-rum:12
@@ -147,15 +147,14 @@ unit-testing-rum:
- mix test --preload-modules
lint:
- image: elixir:1.12
+ image: &current_elixir elixir:1.12-alpine
stage: test
only:
- changes:
- - "**/*.ex"
- - "**/*.exs"
- - "mix.lock"
+ changes: *build_changes_policy
cache: *testing_cache_policy
- before_script:
+ before_script: &current_bfr_script
+ - apk update
+ - apk add build-base cmake file-dev git openssl
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
@@ -165,29 +164,18 @@ lint:
analysis:
stage: test
only:
- changes:
- - "**/*.ex"
- - "**/*.exs"
- - "mix.lock"
+ changes: *build_changes_policy
cache: *testing_cache_policy
script:
- mix credo --strict --only=warnings,todo,fixme,consistency,readability
cycles:
+ image: *current_elixir
stage: test
- image: elixir:1.11
only:
- changes:
- - "**/*.ex"
- - "**/*.exs"
- - "mix.lock"
+ changes: *build_changes_policy
cache: {}
- before_script:
- - mix local.hex --force
- - mix local.rebar --force
- - mix deps.get
- - apt-get update
- - apt-get install cmake libmagic-dev -y
+ before_script: *current_bfr_script
script:
- mix compile
- mix xref graph --format cycles --label compile | awk '{print $0} END{exit ($0 != "No cycles found")}'
@@ -266,12 +254,14 @@ stop_review_app:
amd64:
stage: release
- image: elixir:1.10.4
+ image: elixir:1.11.4
only: &release-only
- stable@pleroma/pleroma
- develop@pleroma/pleroma
- /^maint/.*$/@pleroma/pleroma
- /^release/.*$/@pleroma/pleroma
+ tags:
+ - amd64
artifacts: &release-artifacts
name: "pleroma-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
paths:
@@ -290,7 +280,7 @@ amd64:
MIX_ENV: prod
before_script: &before-release
- apt-get update && apt-get install -y cmake libmagic-dev
- - echo "import Mix.Config" > config/prod.secret.exs
+ - echo "import Config" > config/prod.secret.exs
- mix local.hex --force
- mix local.rebar --force
script: &release
@@ -304,12 +294,14 @@ amd64-musl:
stage: release
artifacts: *release-artifacts
only: *release-only
- image: elixir:1.10.4-alpine
+ image: elixir:1.11.4-alpine
+ tags:
+ - amd64
cache: *release-cache
variables: *release-variables
before_script: &before-release-musl
- - apk add git gcc g++ musl-dev make cmake file-dev
- - echo "import Mix.Config" > config/prod.secret.exs
+ - apk add git build-base cmake file-dev openssl
+ - echo "import Config" > config/prod.secret.exs
- mix local.hex --force
- mix local.rebar --force
script: *release
@@ -320,7 +312,7 @@ arm:
only: *release-only
tags:
- arm32-specified
- image: arm32v7/elixir:1.10.4
+ image: arm32v7/elixir:1.11.4
cache: *release-cache
variables: *release-variables
before_script: *before-release
@@ -332,7 +324,7 @@ arm-musl:
only: *release-only
tags:
- arm32-specified
- image: arm32v7/elixir:1.10.4-alpine
+ image: arm32v7/elixir:1.11.4-alpine
cache: *release-cache
variables: *release-variables
before_script: *before-release-musl
@@ -344,7 +336,7 @@ arm64:
only: *release-only
tags:
- arm
- image: arm64v8/elixir:1.10.4
+ image: arm64v8/elixir:1.11.4
cache: *release-cache
variables: *release-variables
before_script: *before-release
@@ -356,7 +348,7 @@ arm64-musl:
only: *release-only
tags:
- arm
- image: arm64v8/elixir:1.10.4-alpine
+ image: arm64v8/elixir:1.11.4-alpine
cache: *release-cache
variables: *release-variables
before_script: *before-release-musl