diff options
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 64 |
1 files changed, 24 insertions, 40 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3860f1db9..0e7f4926a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: elixir:1.9.4 +image: git.pleroma.social:5050/pleroma/pleroma/ci-base variables: &global_variables POSTGRES_DB: pleroma_test @@ -26,12 +26,7 @@ stages: before_script: - echo $MIX_ENV - rm -rf _build/*/lib/pleroma - - apt-get update && apt-get install -y cmake - - mix local.hex --force - - mix local.rebar --force - mix deps.get - - apt-get -qq update - - apt-get install -y libmagic-dev after_script: - rm -rf _build/*/lib/pleroma @@ -39,7 +34,8 @@ after_script: build: stage: build only: - changes: + changes: &build_changes_policy + - ".gitlab-ci.yml" - "**/*.ex" - "**/*.exs" - "mix.lock" @@ -50,6 +46,7 @@ spec-build: stage: test only: changes: + - ".gitlab-ci.yml" - "lib/pleroma/web/api_spec/**/*.ex" - "lib/pleroma/web/api_spec.ex" artifacts: @@ -64,7 +61,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: @@ -75,20 +72,16 @@ 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: - - apt-get update && apt-get install -y libimage-exiftool-perl ffmpeg - mix ecto.create - mix ecto.migrate - mix coveralls --preload-modules @@ -96,17 +89,15 @@ unit-testing: 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: @@ -133,10 +124,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 @@ -146,46 +134,42 @@ unit-testing-rum: <<: *global_variables RUM_ENABLED: "true" script: - - apt-get update && apt-get install -y libimage-exiftool-perl ffmpeg - mix ecto.create - mix ecto.migrate - "mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/" - mix test --preload-modules lint: - image: elixir:1.12 + image: ¤t_elixir elixir:1.12-alpine stage: test only: - changes: - - "**/*.ex" - - "**/*.exs" - - "mix.lock" + changes: *build_changes_policy cache: *testing_cache_policy + before_script: ¤t_bfr_script + - apk update + - apk add build-base cmake file-dev git openssl + - mix local.hex --force + - mix local.rebar --force + - mix deps.get script: - mix format --check-formatted 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: *current_bfr_script script: - - mix deps.get - mix compile - mix xref graph --format cycles --label compile | awk '{print $0} END{exit ($0 != "No cycles found")}' @@ -305,7 +289,7 @@ amd64-musl: cache: *release-cache variables: *release-variables before_script: &before-release-musl - - apk add git gcc g++ musl-dev make cmake file-dev + - apk add git build-base cmake file-dev openssl - echo "import Mix.Config" > config/prod.secret.exs - mix local.hex --force - mix local.rebar --force |