From 3730ba22a55c34aafff650ded61e790b69947857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Eppl=C3=A9e?= Date: Wed, 18 Jun 2025 12:13:18 +0200 Subject: [PATCH 1/3] Fix postgres port in CI --- .drone.yml | 1 + config/test.exs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 1dbc9fd..ca154e0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -55,6 +55,7 @@ steps: environment: MIX_ENV: test TEST_POSTGRES_HOST: postgres + TEST_POSTGRES_PORT: 5432 commands: # Install hex package manager - mix local.hex --force diff --git a/config/test.exs b/config/test.exs index 68beeb0..01a8ae8 100644 --- a/config/test.exs +++ b/config/test.exs @@ -9,7 +9,7 @@ config :mv, Mv.Repo, username: "postgres", password: "postgres", hostname: System.get_env("TEST_POSTGRES_HOST", "localhost"), - port: 5000, + port: System.get_env("TEST_POSTGRES_PORT", "5000"), database: "mv_test#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, pool_size: System.schedulers_online() * 2 From b1e6a54e65c380686b442abeeab32ed68e8ef290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Eppl=C3=A9e?= Date: Wed, 28 May 2025 17:34:57 +0200 Subject: [PATCH 2/3] Add CI cache --- .drone.yml | 60 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1dbc9fd..b3d7c16 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,6 +14,26 @@ trigger: - push steps: + - name: compute cache key + image: docker.io/library/elixir:1.18.3-otp-27 + commands: + - echo "$DRONE_REPO_OWNER/$DRONE_REPO_NAME" >> .cache_key + - echo $(sha256sum mix.lock) >> .cache_key + # Print cache key for debugging + - cat .cache_key + + - name: restore-cache + image: drillster/drone-volume-cache + settings: + restore: true + mount: + - ./deps + - ./_build + ttl: 30 + volumes: + - name: cache + path: /tmp/cache + - name: lint image: docker.io/library/elixir:1.18.3-otp-27 commands: @@ -50,18 +70,34 @@ steps: echo "Postgres did not become available, aborting." exit 1 - - name: test - image: docker.io/library/elixir:1.18.3-otp-27 - environment: - MIX_ENV: test - TEST_POSTGRES_HOST: postgres - commands: - # Install hex package manager - - mix local.hex --force - # Fetch dependencies - - mix deps.get - # Run tests - - mix test + # - name: test + # image: docker.io/library/elixir:1.18.3-otp-27 + # environment: + # MIX_ENV: test + # TEST_POSTGRES_HOST: postgres + # commands: + # # Install hex package manager + # - mix local.hex --force + # # Fetch dependencies + # - mix deps.get + # # Run tests + # - mix test + + - name: rebuild-cache + image: drillster/drone-volume-cache + settings: + rebuild: true + mount: + - ./deps + - ./_build + volumes: + - name: cache + path: /tmp/cache + +volumes: + - name: cache + host: + path: /tmp/drone_cache --- kind: pipeline From 2978dc443e1bc5c5582d31b23101cb3aa7acfee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Eppl=C3=A9e?= Date: Wed, 28 May 2025 17:34:57 +0200 Subject: [PATCH 3/3] Add CI cache --- .drone.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.drone.yml b/.drone.yml index ca154e0..d5dc95b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,6 +14,26 @@ trigger: - push steps: + - name: compute cache key + image: docker.io/library/elixir:1.18.3-otp-27 + commands: + - echo "$DRONE_REPO_OWNER/$DRONE_REPO_NAME" >> .cache_key + - echo $(sha256sum mix.lock) >> .cache_key + # Print cache key for debugging + - cat .cache_key + + - name: restore-cache + image: drillster/drone-volume-cache + settings: + restore: true + mount: + - ./deps + - ./_build + ttl: 30 + volumes: + - name: cache + path: /tmp/cache + - name: lint image: docker.io/library/elixir:1.18.3-otp-27 commands: @@ -64,6 +84,22 @@ steps: # Run tests - mix test + - name: rebuild-cache + image: drillster/drone-volume-cache + settings: + rebuild: true + mount: + - ./deps + - ./_build + volumes: + - name: cache + path: /tmp/cache + +volumes: + - name: cache + host: + path: /tmp/drone_cache + --- kind: pipeline type: docker