Merge branch 'shrink-ci' into 'develop'

Shrink CI

See merge request pleroma/pleroma!3691
This commit is contained in:
Haelwenn 2022-07-17 17:34:47 +00:00
commit 3193f18cf3
1 changed files with 20 additions and 39 deletions

View File

@ -34,7 +34,8 @@ after_script:
build: build:
stage: build stage: build
only: only:
changes: changes: &build_changes_policy
- ".gitlab-ci.yml"
- "**/*.ex" - "**/*.ex"
- "**/*.exs" - "**/*.exs"
- "mix.lock" - "mix.lock"
@ -45,6 +46,7 @@ spec-build:
stage: test stage: test
only: only:
changes: changes:
- ".gitlab-ci.yml"
- "lib/pleroma/web/api_spec/**/*.ex" - "lib/pleroma/web/api_spec/**/*.ex"
- "lib/pleroma/web/api_spec.ex" - "lib/pleroma/web/api_spec.ex"
artifacts: artifacts:
@ -59,7 +61,7 @@ benchmark:
variables: variables:
MIX_ENV: benchmark MIX_ENV: benchmark
services: services:
- name: postgres:9.6 - name: postgres:9.6-alpine
alias: postgres alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
script: script:
@ -70,16 +72,13 @@ benchmark:
unit-testing: unit-testing:
stage: test stage: test
only: only:
changes: changes: *build_changes_policy
- "**/*.ex"
- "**/*.exs"
- "mix.lock"
cache: &testing_cache_policy cache: &testing_cache_policy
<<: *global_cache_policy <<: *global_cache_policy
policy: pull policy: pull
services: services:
- name: postgres:13 - name: postgres:13-alpine
alias: postgres alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
script: script:
@ -92,16 +91,13 @@ unit-testing-erratic:
retry: 2 retry: 2
allow_failure: true allow_failure: true
only: only:
changes: changes: *build_changes_policy
- "**/*.ex"
- "**/*.exs"
- "mix.lock"
cache: &testing_cache_policy cache: &testing_cache_policy
<<: *global_cache_policy <<: *global_cache_policy
policy: pull policy: pull
services: services:
- name: postgres:13 - name: postgres:13-alpine
alias: postgres alias: postgres
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
script: script:
@ -128,10 +124,7 @@ unit-testing-erratic:
unit-testing-rum: unit-testing-rum:
stage: test stage: test
only: only:
changes: changes: *build_changes_policy
- "**/*.ex"
- "**/*.exs"
- "mix.lock"
cache: *testing_cache_policy cache: *testing_cache_policy
services: services:
- name: minibikini/postgres-with-rum:12 - name: minibikini/postgres-with-rum:12
@ -147,15 +140,14 @@ unit-testing-rum:
- mix test --preload-modules - mix test --preload-modules
lint: lint:
image: elixir:1.12 image: &current_elixir elixir:1.12-alpine
stage: test stage: test
only: only:
changes: changes: *build_changes_policy
- "**/*.ex"
- "**/*.exs"
- "mix.lock"
cache: *testing_cache_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.hex --force
- mix local.rebar --force - mix local.rebar --force
- mix deps.get - mix deps.get
@ -165,29 +157,18 @@ lint:
analysis: analysis:
stage: test stage: test
only: only:
changes: changes: *build_changes_policy
- "**/*.ex"
- "**/*.exs"
- "mix.lock"
cache: *testing_cache_policy cache: *testing_cache_policy
script: script:
- mix credo --strict --only=warnings,todo,fixme,consistency,readability - mix credo --strict --only=warnings,todo,fixme,consistency,readability
cycles: cycles:
image: *current_elixir
stage: test stage: test
image: elixir:1.11
only: only:
changes: changes: *build_changes_policy
- "**/*.ex" cache: *testing_cache_policy
- "**/*.exs" before_script: *current_bfr_script
- "mix.lock"
cache: {}
before_script:
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- apt-get update
- apt-get install cmake libmagic-dev -y
script: script:
- mix compile - mix compile
- mix xref graph --format cycles --label compile | awk '{print $0} END{exit ($0 != "No cycles found")}' - mix xref graph --format cycles --label compile | awk '{print $0} END{exit ($0 != "No cycles found")}'
@ -308,7 +289,7 @@ amd64-musl:
cache: *release-cache cache: *release-cache
variables: *release-variables variables: *release-variables
before_script: &before-release-musl 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 - echo "import Mix.Config" > config/prod.secret.exs
- mix local.hex --force - mix local.hex --force
- mix local.rebar --force - mix local.rebar --force