mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
Run jobs in parallel (#48)
This commit is contained in:
parent
908061a4e5
commit
57ef12defa
8 changed files with 267 additions and 144 deletions
|
|
@ -8,6 +8,7 @@ module.exports = {
|
|||
'public',
|
||||
'packages/web/app/src/graphql/index.ts',
|
||||
'packages/libraries/cli/src/sdk.ts',
|
||||
'packages/services/storage/src/db/types.ts',
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
name: ci/cd
|
||||
name: CD
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
244
.github/workflows/ci.yaml
vendored
Normal file
244
.github/workflows/ci.yaml
vendored
Normal file
|
|
@ -0,0 +1,244 @@
|
|||
name: CI
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: 'Setup'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:13.1-alpine
|
||||
ports:
|
||||
- 5432:5432
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_USER: postgres
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
env:
|
||||
POSTGRES_HOST: localhost
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_USER: postgres
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
TURBO_PREFLIGHT: 'true'
|
||||
TURBO_API_URL: ${{ secrets.TURBO_API_URL }}
|
||||
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
- name: Create Database
|
||||
working-directory: packages/services/storage
|
||||
run: yarn db:create
|
||||
|
||||
- name: Migrate Database
|
||||
working-directory: packages/services/storage
|
||||
run: yarn db:migrator up
|
||||
|
||||
- name: Generate Database Types
|
||||
working-directory: packages/services/storage
|
||||
run: yarn db:generate
|
||||
|
||||
- name: Check if DB types were modified
|
||||
run: git diff --exit-code ./packages/services/storage/src/db/types.ts
|
||||
|
||||
- name: Share node_modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ github.sha }}
|
||||
|
||||
integration-tests:
|
||||
name: 'Integration Tests'
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
TURBO_PREFLIGHT: 'true'
|
||||
TURBO_API_URL: ${{ secrets.TURBO_API_URL }}
|
||||
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Pull node_modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ github.sha }}
|
||||
|
||||
- name: Build
|
||||
run: yarn workspace integration-tests run build-and-pack
|
||||
env:
|
||||
NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.TEST_STRIPE_PUBLIC_KEY }}
|
||||
|
||||
- name: Pull images
|
||||
run: docker-compose -f integration-tests/docker-compose.yml pull
|
||||
|
||||
- name: Integration Tests
|
||||
run: yarn workspace integration-tests run dockest
|
||||
env:
|
||||
AUTH0_DOMAIN: ${{ secrets.TEST_AUTH0_DOMAIN }}
|
||||
AUTH0_CLIENT_ID: ${{ secrets.TEST_AUTH0_CLIENT_ID }}
|
||||
AUTH0_CLIENT_SECRET: ${{ secrets.TEST_AUTH0_CLIENT_SECRET }}
|
||||
AUTH0_USER_PASSWORD: ${{ secrets.AUTH0_TESTING_USER_PASSWORD }}
|
||||
AUTH0_USER_MAIN_EMAIL: contact@the-guild.dev
|
||||
AUTH0_USER_EXTRA_EMAIL: contact+extra@the-guild.dev
|
||||
AUTH0_SECRET: ${{ secrets.TEST_AUTH0_SECRET }}
|
||||
AUTH0_AUDIENCE: ${{ secrets.TEST_AUTH0_AUDIENCE }}
|
||||
AUTH0_CONNECTION: Username-Password-Authentication
|
||||
STRIPE_SECRET_KEY: ${{ secrets.TEST_STRIPE_SECRET_KEY }}
|
||||
|
||||
- name: Dockest logs
|
||||
if: always()
|
||||
run: cat integration-tests/*.log
|
||||
|
||||
schema-check:
|
||||
name: 'Schema Check'
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
|
||||
env:
|
||||
HIVE_TOKEN: ${{ secrets.HIVE_TOKEN }}
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
TURBO_PREFLIGHT: 'true'
|
||||
TURBO_API_URL: ${{ secrets.TURBO_API_URL }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Pull node_modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ github.sha }}
|
||||
|
||||
- name: Generate Types
|
||||
run: yarn graphql:generate
|
||||
|
||||
- name: Check PR label
|
||||
if: contains(github.event.pull_request.labels.*.name, 'non-breaking')
|
||||
run: echo '::set-output name=SAFE_FLAG::--forceSafe'
|
||||
id: pr-label-check
|
||||
|
||||
- name: Schema Check
|
||||
run: ./packages/libraries/cli/bin/dev schema:check "packages/services/api/src/modules/*/module.graphql.ts" ${{ steps.pr-label-check.outputs.SAFE_FLAG }} --github
|
||||
|
||||
test:
|
||||
name: 'Tests'
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
TURBO_PREFLIGHT: 'true'
|
||||
TURBO_API_URL: ${{ secrets.TURBO_API_URL }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Pull node_modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ github.sha }}
|
||||
|
||||
- name: Generate Types
|
||||
run: yarn graphql:generate
|
||||
|
||||
- name: Test
|
||||
run: yarn test
|
||||
|
||||
build:
|
||||
name: 'Build'
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
TURBO_PREFLIGHT: 'true'
|
||||
TURBO_API_URL: ${{ secrets.TURBO_API_URL }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Pull node_modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ github.sha }}
|
||||
|
||||
- name: Generate Types
|
||||
run: yarn graphql:generate
|
||||
|
||||
- name: Build
|
||||
run: yarn build
|
||||
|
||||
type-check:
|
||||
name: 'Check types'
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
TURBO_PREFLIGHT: 'true'
|
||||
TURBO_API_URL: ${{ secrets.TURBO_API_URL }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Pull node_modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ github.sha }}
|
||||
|
||||
- name: Generate Types
|
||||
run: yarn graphql:generate
|
||||
|
||||
- name: Type Check
|
||||
run: yarn typecheck
|
||||
58
.github/workflows/integration.yaml
vendored
58
.github/workflows/integration.yaml
vendored
|
|
@ -1,58 +0,0 @@
|
|||
name: Integration Tests
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
integration-tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
TURBO_PREFLIGHT: 'true'
|
||||
TURBO_API_URL: ${{ secrets.TURBO_API_URL }}
|
||||
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Turbo cache
|
||||
with:
|
||||
path: node_modules/.cache/turbo
|
||||
key: ${{ runner.os }}-turbo-cache-v1-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Generate Types
|
||||
run: yarn graphql:generate
|
||||
|
||||
- name: Build
|
||||
run: yarn workspace integration-tests run build-and-pack
|
||||
env:
|
||||
NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.TEST_STRIPE_PUBLIC_KEY }}
|
||||
|
||||
- name: Pull images
|
||||
run: docker-compose -f integration-tests/docker-compose.yml pull
|
||||
|
||||
- name: Integration Tests
|
||||
run: yarn workspace integration-tests run dockest
|
||||
env:
|
||||
AUTH0_DOMAIN: ${{ secrets.TEST_AUTH0_DOMAIN }}
|
||||
AUTH0_CLIENT_ID: ${{ secrets.TEST_AUTH0_CLIENT_ID }}
|
||||
AUTH0_CLIENT_SECRET: ${{ secrets.TEST_AUTH0_CLIENT_SECRET }}
|
||||
AUTH0_USER_PASSWORD: ${{ secrets.AUTH0_TESTING_USER_PASSWORD }}
|
||||
AUTH0_USER_MAIN_EMAIL: contact@the-guild.dev
|
||||
AUTH0_USER_EXTRA_EMAIL: contact+extra@the-guild.dev
|
||||
AUTH0_SECRET: ${{ secrets.TEST_AUTH0_SECRET }}
|
||||
AUTH0_AUDIENCE: ${{ secrets.TEST_AUTH0_AUDIENCE }}
|
||||
AUTH0_CONNECTION: Username-Password-Authentication
|
||||
STRIPE_SECRET_KEY: ${{ secrets.TEST_STRIPE_SECRET_KEY }}
|
||||
|
||||
- name: Dockest logs
|
||||
if: always()
|
||||
run: cat integration-tests/*.log
|
||||
78
.github/workflows/pr.yaml
vendored
78
.github/workflows/pr.yaml
vendored
|
|
@ -1,78 +0,0 @@
|
|||
name: PR Checks
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
pr-checks:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:13.1-alpine
|
||||
ports:
|
||||
- 5432:5432
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_USER: postgres
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
env:
|
||||
POSTGRES_HOST: localhost
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_USER: postgres
|
||||
HIVE_TOKEN: ${{ secrets.HIVE_TOKEN }}
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
TURBO_PREFLIGHT: 'true'
|
||||
TURBO_API_URL: ${{ secrets.TURBO_API_URL }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Turbo cache
|
||||
with:
|
||||
path: node_modules/.cache/turbo
|
||||
key: ${{ runner.os }}-turbo-cache-v1-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Generate Types
|
||||
run: yarn graphql:generate
|
||||
|
||||
- name: Check PR label
|
||||
if: contains(github.event.pull_request.labels.*.name, 'non-breaking')
|
||||
run: echo '::set-output name=SAFE_FLAG::--forceSafe'
|
||||
id: pr-label-check
|
||||
|
||||
- name: Schema Check
|
||||
run: ./packages/libraries/cli/bin/dev schema:check "packages/services/api/src/modules/*/module.graphql.ts" ${{ steps.pr-label-check.outputs.SAFE_FLAG }} --github
|
||||
|
||||
- name: Create Database
|
||||
working-directory: packages/services/storage
|
||||
run: yarn db:create
|
||||
|
||||
- name: Migrate Database
|
||||
working-directory: packages/services/storage
|
||||
run: yarn db:migrator up
|
||||
|
||||
- name: Generate Database Types
|
||||
working-directory: packages/services/storage
|
||||
run: yarn db:generate
|
||||
|
||||
- name: Build
|
||||
run: yarn build
|
||||
|
||||
- name: Test
|
||||
run: yarn test
|
||||
|
||||
- name: Type Check
|
||||
run: yarn typecheck
|
||||
|
|
@ -12,4 +12,5 @@ coverage
|
|||
out
|
||||
dist
|
||||
temp
|
||||
__generated__
|
||||
__generated__
|
||||
packages/services/storage/src/db/types.ts
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
* AUTO-GENERATED FILE @ 2022-05-16 17:20:59 - DO NOT EDIT!
|
||||
* AUTO-GENERATED FILE - DO NOT EDIT!
|
||||
*
|
||||
* This file was automatically generated by schemats v.7.0.0
|
||||
* $ schemats generate -c postgres://username:password@localhost:5432/registry?sslmode=disable -t activities -t alert_channels -t alerts -t commits -t migration -t organization_member -t organizations -t organizations_billing -t persisted_operations -t projects -t target_validation -t targets -t tokens -t users -t version_commit -t versions -s public
|
||||
*
|
||||
*/
|
||||
|
||||
export type alert_channel_type = 'SLACK' | 'WEBHOOK';
|
||||
export type alert_type = 'SCHEMA_CHANGE_NOTIFICATIONS';
|
||||
export type operation_kind = 'mutation' | 'query' | 'subscription';
|
||||
export type organization_type = 'PERSONAL' | 'REGULAR';
|
||||
export type user_role = 'ADMIN' | 'MEMBER';
|
||||
export type alert_channel_type = "SLACK" | "WEBHOOK";
|
||||
export type alert_type = "SCHEMA_CHANGE_NOTIFICATIONS";
|
||||
export type operation_kind = "mutation" | "query" | "subscription";
|
||||
export type organization_type = "PERSONAL" | "REGULAR";
|
||||
export type user_role = "ADMIN" | "MEMBER";
|
||||
|
||||
export interface activities {
|
||||
activity_metadata: any;
|
||||
|
|
|
|||
13
patches/@tgriesser+schemats+7.0.0.patch
Normal file
13
patches/@tgriesser+schemats+7.0.0.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/node_modules/@tgriesser/schemats/src/index.js b/node_modules/@tgriesser/schemats/src/index.js
|
||||
index 27a7b2e..2490a40 100644
|
||||
--- a/node_modules/@tgriesser/schemats/src/index.js
|
||||
+++ b/node_modules/@tgriesser/schemats/src/index.js
|
||||
@@ -40,7 +40,7 @@ function buildHeader(db, tables, schema, options) {
|
||||
}
|
||||
return `
|
||||
/**
|
||||
- * AUTO-GENERATED FILE @ ${getTime()} - DO NOT EDIT!
|
||||
+ * AUTO-GENERATED FILE - DO NOT EDIT!
|
||||
*
|
||||
* This file was automatically generated by schemats v.${pkgVersion}
|
||||
* $ ${commands.join(' ')}
|
||||
Loading…
Reference in a new issue