From 38fd3e580415bfa775a662d3202f7c0494de78d1 Mon Sep 17 00:00:00 2001 From: Ayoub Abidi Date: Sun, 4 Feb 2024 13:41:42 +0100 Subject: [PATCH 1/5] docs: update logo --- src/assets/mercury-logo.png | Bin 1766 -> 4837 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/assets/mercury-logo.png b/src/assets/mercury-logo.png index 85cdc40e1a2ec84030cb2a3ca17d408a0286cbf8..9e895326346200c6c7e12585ade3be1180403d0a 100644 GIT binary patch literal 4837 zcmZ`-^;6Uj6aHLqw1hMQCyk^E9;F=3apb{)bax6T9Vek6A_z!GH`3iHf(WRzNDC_6 z-7nui;C*JE-PxF(+28irNG%OzauOyI0078QDhikzkN=NEup8U`#A4vaK|SSAx?62=?6A~!)%0kDyad$FdiqPC% zJRYCBsDmq*hx1Bupg+MaQWyvoJd_wITo>$V2=73l;0U$J>fbO67A6?O;?nlhKKt$K+jYepGtA3 zxI$PAt}!tvJ)m~dRkq8#1VlDD=SKtmMwr`{E~)lMl;I&FUw07vVw3JRQ9Wa4=cY@B zWr6<27^Upo49?~>bl4nPZ+#_ZwB&X>OAH8OSv3OhKTJJi^Y3wGjJ9Y3k)4v2_fKqk zfg14ftQ^xP56BMcr#oi+ zP1u9P#TSm-t1fy@B!mqu203s;k{z+27jLNC$+B40W_8s$U_T~3W{)!s%6S6b9?nlX zP*VkBW$-Vyyog9(1LSzzu&Qt7N$j}c;3vfZt)vh0fndXFI1jG?0^kd;_NF0tTmZ9R zOm8z_E(ValPT}kM$s|%RN(KyX$Mdh+#^AI!1TBF<4Y|Lgokako30R>?v+pAq9C~*w z^JT4Jq^~a6T?&iDuP`OhA+?=B06ez_>LiH;lzlmd{_8Wi%vT6R3@x;MkUYXcu!lAY zw&sGx)Nm5#sWWOMJ+}BfZn)P`&{no^b{BT!-)qSyYjtX;T*?9?9qS;nT*GdgK7Tjv z_le5^iy@P3&GO^1)wXSD@2%{j9b6|qNM^T(J7E>|+kZC1<`n7l#m;t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*qaSk zK;|h?YZ6Q1Qeguw+el+AXhG(}5yF7+lTiQgFd zv!`6Jv2@m2!rx*4%SyE(Fej%g?%!h`Ee!%OhGRQg;@z5HYni?*uJm2TLm@fu25TMA zgl|?-LJHbGpW53hjRhO&@V5tFw5EU&;NniWA2N^1)EKUzxgWPM3(jCE5I z->)|5UXZO9g?|rh7tNqZc(azUEfoV#IK+X!T55mF8RDj$zTxv`KEY#gsIb;`&w5y2 zZ+_Qkh{?NAG!wQB!$*SHU+B?lWl%~bNPB)lYIbXYDp zyul)o0!pX%qcFtPQY5@Me1_mUkpeg$9KHnMCJ_htW-Ar4TPl5KD}mAUbIG9!*dgMA zmiSY+kg!0cR{?uPT+js18J3|zz6C`j7-LB%!3Gf*`j=uRt(S%))e&>wY8#^CCgz;8sQOPvnDSt-+euU!Cc58N4aSoZ!ZH*>SQ* zB Date: Sun, 4 Feb 2024 13:50:10 +0100 Subject: [PATCH 2/5] feat: add gitlab ci unit and integration tests --- .gitlab-ci.yml | 24 ++++++++++++++++++++++++ CI/integration-test.sh | 3 +++ CI/unit-test.sh | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 CI/integration-test.sh create mode 100644 CI/unit-test.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ee4e0e5 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +stages: + - test + +unit_test: + stage: test + script: + - setsid ./ci/unit-test.sh + only: + refs: + - /^(main|develop.*)$/ + - merge_requests + tags: + - imagesbuilder + +integration_test: + stage: test + script: + - setsid ./ci/integration-test.sh + only: + refs: + - /^(main|develop.*)$/ + - merge_requests + tags: + - imagesbuilder \ No newline at end of file diff --git a/CI/integration-test.sh b/CI/integration-test.sh new file mode 100644 index 0000000..f38e7d9 --- /dev/null +++ b/CI/integration-test.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker-compose up --build --abort-on-container-exit mercury_integration_tests \ No newline at end of file diff --git a/CI/unit-test.sh b/CI/unit-test.sh new file mode 100644 index 0000000..c108d5a --- /dev/null +++ b/CI/unit-test.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker-compose up --build --abort-on-container-exit mercury_unit_tests \ No newline at end of file From 8fb75f4f0510f482487cb5309ed9cb669c784420 Mon Sep 17 00:00:00 2001 From: Ayoub Abidi Date: Sun, 4 Feb 2024 13:59:09 +0100 Subject: [PATCH 3/5] ci: add github test workflow --- .github/workflows/test.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..8b85c75 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop + +jobs: + unit_test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Run unit tests + run: | + ./ci/unit-test.sh + + integration_test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Run integration tests + run: | + ./ci/integration-test.sh From dad33d7dbc391a458acd1c7566137e780e2391f3 Mon Sep 17 00:00:00 2001 From: Ayoub Abidi Date: Sun, 4 Feb 2024 14:29:46 +0100 Subject: [PATCH 4/5] ci: add release workflow --- .github/workflows/release.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f23e19b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false \ No newline at end of file From fe7c3606a2a23c32c51121f28a923722b69170e8 Mon Sep 17 00:00:00 2001 From: Ayoub Abidi Date: Sun, 4 Feb 2024 14:33:17 +0100 Subject: [PATCH 5/5] ci: make test workflow take secrets --- .env.dist | 37 +++++++++++++++++----------------- .github/workflows/test.yml | 30 +++++++++++++++++++++------ {CI => ci}/integration-test.sh | 0 {CI => ci}/unit-test.sh | 2 +- 4 files changed, 43 insertions(+), 26 deletions(-) rename {CI => ci}/integration-test.sh (100%) mode change 100644 => 100755 rename {CI => ci}/unit-test.sh (92%) mode change 100644 => 100755 diff --git a/.env.dist b/.env.dist index 075d6e9..e42ce9c 100644 --- a/.env.dist +++ b/.env.dist @@ -1,24 +1,23 @@ -APP_TITLE = "Mercury API Docs" -APP_DESCRIPTION = "This is the Swagger documentation of the Mercury API" -APP_VERSION = 1.0 -API_VERSION = "v1" +APP_TITLE="Mercury API Docs" +APP_DESCRIPTION="This is the Swagger documentation of the Mercury API" +APP_VERSION=1.0 +API_VERSION="v1" APP_ENV=local ## Admin Configuration -ADMIN_USERNAME = "admin" -ADMIN_EMAIL = "admin" -ADMIN_PASSWORD = "admin" +ADMIN_USERNAME="admin" +ADMIN_EMAIL="admin" +ADMIN_PASSWORD="admin" ## Postgres Configuration -POSTGRES_HOST_AUTH_METHOD = changeit -POSTGRES_PASSWORD = mercury -POSTGRES_HOST = mercury_db -POSTGRES_PORT = 5432 -POSTGRES_USER = mercury -POSTGRES_DB = mercury -POSTGRES_HOST_AUTH_METHOD = trust +POSTGRES_HOST=mercury_db +POSTGRES_PASSWORD=mercury +POSTGRES_PORT=5432 +POSTGRES_USER=mercury +POSTGRES_DB=mercury +POSTGRES_HOST_AUTH_METHOD=trust ## Redis Configuration -REDIS_HOST = mercury_cache -REDIS_PORT = 6379 +REDIS_HOST=mercury_cache +REDIS_PORT=6379 ## JWT Configuration -JWT_SECRET_KEY = "mysecretkey" -JWT_ALGORITHM = "HS256" -ACCESS_TOKEN_EXPIRE_MINUTES = 30 +JWT_SECRET_KEY="mysecretkey" +JWT_ALGORITHM="HS256" +ACCESS_TOKEN_EXPIRE_MINUTES=30 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8b85c75..896d9df 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,20 +11,38 @@ on: - develop jobs: - unit_test: + integration_test: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - - name: Run unit tests + + - name: Create environment file run: | - ./ci/unit-test.sh + echo "POSTGRES_HOST=${{ secrets.POSTGRES_HOST }}" > .env + echo "POSTGRES_PORT=${{ secrets.POSTGRES_PORT }}" >> .env + echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env + echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env + echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env - integration_test: + - name: Run integration tests + run: | + setsid ./ci/integration-test.sh + + unit_test: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - - name: Run integration tests + + - name: Create environment file + run: | + echo "POSTGRES_HOST=${{ secrets.POSTGRES_HOST }}" > .env + echo "POSTGRES_PORT=${{ secrets.POSTGRES_PORT }}" >> .env + echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env + echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env + echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env + + - name: Run unit tests run: | - ./ci/integration-test.sh + setsid ./ci/unit-test.sh diff --git a/CI/integration-test.sh b/ci/integration-test.sh old mode 100644 new mode 100755 similarity index 100% rename from CI/integration-test.sh rename to ci/integration-test.sh diff --git a/CI/unit-test.sh b/ci/unit-test.sh old mode 100644 new mode 100755 similarity index 92% rename from CI/unit-test.sh rename to ci/unit-test.sh index c108d5a..e67999c --- a/CI/unit-test.sh +++ b/ci/unit-test.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -docker-compose up --build --abort-on-container-exit mercury_unit_tests \ No newline at end of file +docker-compose up --build --abort-on-container-exit mercury_unit_tests