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 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"

View file

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

View file

@ -63,16 +63,24 @@ jobs:
- name: load env
run: |
mkdir -p db/db-sqlx-sqlite/tmp &&
source .env-sample \
&& echo "POSTGRES_DATABASE_URL=$POSTGRES_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
run:
make
# env:
# POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
# SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}"
env:
POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}"
SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}"
# - name: build docker images
# 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'
# 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
timeout-minutes: 40
run: