diff --git a/.env-sample b/.env-sample index 39c32e2..8672dfc 100644 --- a/.env-sample +++ b/.env-sample @@ -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" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 330dba4..f8bddd2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 23c75d7..0843694 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -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: