chore: fix CI

This commit is contained in:
Aravinth Manivannan 2022-04-13 15:01:17 +05:30
parent fc690fbefe
commit df4343c667
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
3 changed files with 21 additions and 18 deletions

View file

@ -1,3 +1,3 @@
export POSTGRES_DATABASE_URL="postgres://postgres:password@localhost:5432/postgres" export POSTGRES_DATABASE_URL="postgres://postgres:password@localhost:5432/postgres"
export SQLITE_TMP="$(pwd)/database/db-sqlx-sqlite/tmp" export SQLITE_TMP="$(pwd)/db/db-sqlx-sqlite/tmp"
export SQLITE_DATABASE_URL="sqlite://$SQLITE_TMP/admin.db" export SQLITE_DATABASE_URL="sqlite://$SQLITE_TMP/admin.db"

View file

@ -53,17 +53,19 @@ jobs:
- name: load env - name: load env
run: | run: |
mkdir -p db/db-sqlx-sqlite/tmp &&
source .env-sample \ source .env-sample \
&& echo "POSTGRES_DATABASE_URL=$POSTGRES_DATABASE_URL" >> $GITHUB_ENV \ && echo "POSTGRES_DATABASE_URL=$POSTGRES_DATABASE_URL" >> $GITHUB_ENV \
&& echo "SQLITE_DATABASE_URL=$SQLITE_DATABASE_URL" >> $GITHUB_ENV && echo "SQLITE_DATABASE_URL=$SQLITE_DATABASE_URL" >> $GITHUB_ENV
- name: launch gitea # usually run as part of `make test` but because this workflow doesn't run
timeout-minutes: 10 # that command, `make dev-env` is used
run: docker-compose -f docker-compose-dev-deps.yml up --detach - name: setup dev environment
run: make dev-env
- name: Install and setup Gitea env:
timeout-minutes: 10 GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value
run: python ./scripts/gitea.py POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}"
- name: run migrations - name: run migrations
run: make migrate run: make migrate

View file

@ -63,16 +63,24 @@ jobs:
- name: load env - name: load env
run: | run: |
mkdir -p db/db-sqlx-sqlite/tmp &&
source .env-sample \ source .env-sample \
&& echo "POSTGRES_DATABASE_URL=$POSTGRES_DATABASE_URL" >> $GITHUB_ENV \ && echo "POSTGRES_DATABASE_URL=$POSTGRES_DATABASE_URL" >> $GITHUB_ENV \
&& echo "SQLITE_DATABASE_URL=$SQLITE_DATABASE_URL" >> $GITHUB_ENV && echo "SQLITE_DATABASE_URL=$SQLITE_DATABASE_URL" >> $GITHUB_ENV
- name: run migrations
run: make migrate
env:
GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value
POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}"
- name: build - name: build
run: run:
make make
# env: env:
# POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
# SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}"
# - name: build docker images # - name: build docker images
# if: matrix.version == 'stable' # if: matrix.version == 'stable'
@ -82,13 +90,6 @@ jobs:
# if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'forgeflux-org/starchart' # if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'forgeflux-org/starchart'
# run: make docker-publish # run: make docker-publish
# #
- name: run migrations
run: make migrate
env:
GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value
POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}"
- name: run tests - name: run tests
timeout-minutes: 40 timeout-minutes: 40
run: run: