akkoma/.woodpecker/test.yml

118 lines
2.6 KiB
YAML
Raw Normal View History

2023-08-01 15:20:46 +00:00
platform: linux/amd64
2023-08-01 10:43:50 +00:00
matrix:
ELIXIR_VERSION:
- 1.14
- 1.15
2023-08-02 12:49:42 +00:00
OTP_VERSION:
- 25
- 26
include:
2023-08-02 15:52:56 +00:00
- ELIXIR_VERSION: 1.14
OTP_VERSION: 25
2023-08-02 12:49:42 +00:00
- ELIXIR_VERSION: 1.15
OTP_VERSION: 25
2023-08-02 15:52:56 +00:00
- ELIXIR_VERSION: 1.15
OTP_VERSION: 26
2023-08-01 10:43:50 +00:00
2023-07-20 16:27:58 +00:00
variables:
- &scw-secrets
- SCW_ACCESS_KEY
- SCW_SECRET_KEY
- SCW_DEFAULT_ORGANIZATION_ID
- &setup-hex "mix local.hex --force && mix local.rebar --force"
- &on-release
when:
event:
- push
- tag
branch:
- develop
- stable
- refs/tags/v*
- refs/tags/stable-*
- &on-stable
when:
event:
- push
- tag
branch:
- stable
- refs/tags/stable-*
- &on-point-release
when:
event:
- push
branch:
- develop
- stable
- &on-pr-open
when:
event:
- pull_request
- &tag-build "export BUILD_TAG=$${CI_COMMIT_TAG:-\"$CI_COMMIT_BRANCH\"} && export PLEROMA_BUILD_BRANCH=$BUILD_TAG"
- &clean "(rm -rf release || true) && (rm -rf _build || true) && (rm -rf /root/.mix)"
- &mix-clean "mix deps.clean --all && mix clean"
services:
postgres:
image: postgres:15
when:
event:
- pull_request
environment:
2023-08-02 12:54:24 +00:00
POSTGRES_DB: pleroma_test_${ELIXIR_VERSION}_${OTP_VERSION}
2023-07-20 16:27:58 +00:00
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
pipeline:
lint:
<<: *on-pr-open
2023-08-01 10:43:50 +00:00
image: akkoma/ci-base:1.15
2023-07-20 16:27:58 +00:00
commands:
- mix local.hex --force
- mix local.rebar --force
- mix format --check-formatted
build:
2023-08-02 12:54:24 +00:00
image: akkoma/ci-base:${ELIXIR_VERSION}-otp${OTP_VERSION}
2023-07-20 16:27:58 +00:00
<<: *on-pr-open
environment:
MIX_ENV: test
2023-08-02 12:54:24 +00:00
POSTGRES_DB: pleroma_test_${ELIXIR_VERSION}_${OTP_VERSION}
2023-07-20 16:27:58 +00:00
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DB_HOST: postgres
commands:
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix compile
test:
2023-08-02 12:54:24 +00:00
image: akkoma/ci-base:${ELIXIR_VERSION}-otp${OTP_VERSION}
2023-07-20 16:27:58 +00:00
<<: *on-pr-open
environment:
MIX_ENV: test
2023-08-02 12:54:24 +00:00
POSTGRES_DB: pleroma_test_${ELIXIR_VERSION}_${OTP_VERSION}
2023-07-20 16:27:58 +00:00
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DB_HOST: postgres
commands:
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix compile
- mix ecto.drop -f -q
- mix ecto.create
- mix ecto.migrate
2023-08-02 16:36:13 +00:00
- mkdir -p test/tmp
2023-08-02 16:12:11 +00:00
- |
for i in $(seq 1 10)
do
echo "PARTITION $i"
2023-08-02 16:48:21 +00:00
MIX_TEST_PARTITION=$i mix test --preload-modules --exclude erratic --exclude federated --partitions 10 --max-cases 1
2023-08-02 16:12:11 +00:00
done