-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): fix GitHub action workflows (#588)
* chore(ci): create env file in set up action * chore(ci): add set up db action * chore(ci): use set up db action
- Loading branch information
Showing
3 changed files
with
47 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,9 @@ jobs: | |
postgres: | ||
image: postgres:16 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: blobscan_dev | ||
POSTGRES_USER: blobscan | ||
POSTGRES_PASSWORD: s3cr3t | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
|
@@ -49,6 +51,9 @@ jobs: | |
- name: Setup | ||
uses: ./tooling/github/setup | ||
|
||
- name: Setup DB | ||
uses: ./tooling/github/setup-db | ||
|
||
- name: Typecheck | ||
run: pnpm type-check | ||
|
||
|
@@ -57,7 +62,9 @@ jobs: | |
postgres: | ||
image: postgres:16 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: blobscan_dev | ||
POSTGRES_USER: blobscan | ||
POSTGRES_PASSWORD: s3cr3t | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
|
@@ -72,6 +79,9 @@ jobs: | |
- name: Setup | ||
uses: ./tooling/github/setup | ||
|
||
- name: Setup DB | ||
uses: ./tooling/github/setup-db | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
|
@@ -80,7 +90,9 @@ jobs: | |
postgres: | ||
image: postgres:16 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: blobscan_dev | ||
POSTGRES_USER: blobscan | ||
POSTGRES_PASSWORD: s3cr3t | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
|
@@ -107,6 +119,9 @@ jobs: | |
- name: Setup | ||
uses: ./tooling/github/setup | ||
|
||
- name: Setup DB | ||
uses: ./tooling/github/setup-db | ||
|
||
- name: Setup GCS emulator | ||
uses: fsouza/[email protected] | ||
with: | ||
|
@@ -118,16 +133,8 @@ jobs: | |
- name: Generate Prisma Client | ||
run: pnpm db:generate | ||
|
||
- name: Test migrations | ||
run: pnpm prisma migrate deploy --schema packages/db/prisma/schema.prisma | ||
env: | ||
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/blobscan_ci?schema=public | ||
|
||
- name: Test | ||
run: pnpm coverage | ||
env: | ||
POSTGRES_STORAGE_ENABLED: true | ||
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/blobscan_ci | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: "Set up DB" | ||
description: "Set up the database for the CI environment" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Create .env file with db connection" | ||
uses: "SpicyPizza/[email protected]" | ||
with: | ||
envkey_DATABASE_URL: "postgresql://blobscan:s3cr3t@localhost:5432/blobscan_dev?schema=public" | ||
- name: "Apply Prisma migrations to db" | ||
shell: bash | ||
run: pnpm prisma migrate deploy --schema packages/db/prisma/schema.prisma |