Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add DB migrations to test CI workflow #173

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/migrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: DB Migration

on:
pull_request:
branches: [main]

jobs:
checks:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.GH_ACCESS_TOKEN }}

- name: Update
run: sudo apt update
- name: Install OS dependencies
run: sudo apt install -y python3-dev nodejs

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install graphile-migrate
run: npm install -g graphile-migrate

- name: Install NodeJS dependencies
run: yarn install

- name: Codegen TypeScript
run: yarn codegen

- name: Build TypeScript
run: yarn build

- name: Start-up local test environment
uses: isbang/[email protected]
with:
compose-file: "./ci-compose.yml"

- name: Graphile-migrate reset DB
run: docker compose stop subquery-node && . .gm.env && graphile-migrate reset --erase

- name: Run graphile-migrate migrations
run: . .gm.env && graphile-migrate migrate
4 changes: 2 additions & 2 deletions .github/workflows/test.yml → .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: End-to-end tests
name: Repo Quality

on:
pull_request:
branches: [main]

jobs:
e2e-tests:
checks:
runs-on: ubuntu-latest

steps:
Expand Down
5 changes: 3 additions & 2 deletions ci-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ version: "3"

services:
postgres:
image: gcr.io/fetch-ai-images/subquery-postgres:863ce7d
# image: gcr.io/fetch-ai-images/subquery-postgres:863ce7d
image: jonathansumner/ledger-subquery-postgres:latest
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to push this to fetch-ai-images right?

ports:
- 5432:5432
environment:
Expand Down Expand Up @@ -135,4 +136,4 @@ services:
WASM_RELAYER_MNEMONIC: "all expect burger grit believe forest match math holiday polar roof soccer thank focus note lion gesture dream bounce pony whip scale group refuse"
expose:
- 3000 # REST API https://hermes.informal.systems/rest-api.html#endpoints
- 3001 # prometheus telemetry
- 3001 # prometheus telemetry
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ version: "3"

services:
postgres:
build:
context: ./docker/
dockerfile: ./plv8.dockerfile
# build:
# context: ./docker/
# dockerfile: ./plv8.dockerfile
image: jonathansumner/ledger-subquery-postgres:latest
Copy link

@jrriehl jrriehl Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here?

ports:
- 5432:5432
environment:
Expand Down