From d7d4bfb2f1204889a26cffa3502a9299810d33df Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Tue, 28 Jan 2025 16:13:55 +0100 Subject: [PATCH 1/6] Add DroneCI --- .drone.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..25e9625 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,33 @@ +kind: pipeline +type: docker +name: default + +steps: +- name: install + image: elixir:1.18 + volumes: + - name: mix + path: /root/.mix + commands: + - mix local.rebar --force + - mix local.hex --force + - mix deps.get + +- name: test + image: elixir:1.18 + volumes: + - name: mix + path: /root/.mix + commands: + - mix test + +volumes: +- name: mix + temp: {} + +services: +- name: database + image: postgres:17.2-alpine + environment: + POSTGRES_USER: postgres + POSTGRES_DB: test -- 2.47.2 From 5a0f2160dc3cc882e364ef31ce9ea81b8759e5c2 Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Tue, 28 Jan 2025 16:26:17 +0100 Subject: [PATCH 2/6] Empty -- 2.47.2 From ab593ebf1afb1c0353e2565be657c9038dad7cb0 Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Tue, 28 Jan 2025 16:29:21 +0100 Subject: [PATCH 3/6] Correct db name --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 25e9625..163e85d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -30,4 +30,4 @@ services: image: postgres:17.2-alpine environment: POSTGRES_USER: postgres - POSTGRES_DB: test + POSTGRES_DB: tradex_test -- 2.47.2 From d9e08021e893586ed5d14b972988923c77bba9c2 Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Tue, 28 Jan 2025 16:31:41 +0100 Subject: [PATCH 4/6] Set password --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 163e85d..e4b1a3f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -30,4 +30,5 @@ services: image: postgres:17.2-alpine environment: POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres POSTGRES_DB: tradex_test -- 2.47.2 From 4af59ed652b326f1f5fb077ed7e17e22c6efaa6c Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Tue, 28 Jan 2025 16:49:09 +0100 Subject: [PATCH 5/6] postgres host --- .drone.yml | 2 +- config/test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index e4b1a3f..bbaf2c2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,7 +26,7 @@ volumes: temp: {} services: -- name: database +- name: postgres image: postgres:17.2-alpine environment: POSTGRES_USER: postgres diff --git a/config/test.exs b/config/test.exs index f9a6674..11c1537 100644 --- a/config/test.exs +++ b/config/test.exs @@ -29,7 +29,7 @@ config :tradex, Tradex.Mailer, adapter: Swoosh.Adapters.Test config :tradex, Tradex.Repo, username: "postgres", password: "postgres", - hostname: "localhost", + hostname: if(System.get_env("CI") == "true", do: "postgres", else: "localhost"), database: "tradex_test#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, # We don't run a server during test. If one is required, -- 2.47.2 From 7cc499085fdb3ded7e657b7a185abf5d867bf8ca Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Wed, 19 Feb 2025 14:32:03 +0100 Subject: [PATCH 6/6] Test gitea workflow --- .github/workflows/workflow.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..c537cc6 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,19 @@ +name: Gitea Actions Demo +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: [push] + +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ gitea.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." -- 2.47.2