Skip to content

Json field

Json field #227

Workflow file for this run

name: Keystone CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
should_run_tests:
name: Should run tests
runs-on: ubuntu-22.04
outputs:
shouldRunTests: ${{ env.SHOULD_RUN_TESTS }}
steps:
- uses: dorny/paths-filter@v2
id: filter
if: github.event_name == 'pull_request'
with:
filters: |
shouldRunTests:
- '!{{website,docs,examples}/**,**/*.md}'
- run: echo "SHOULD_RUN_TESTS=$SHOULD_RUN" >> $GITHUB_ENV
if: github.event_name == 'pull_request'
env:
SHOULD_RUN: ${{ steps.filter.outputs.shouldRunTests }}
- run: echo "SHOULD_RUN_TESTS=true" >> $GITHUB_ENV
if: github.event_name != 'pull_request'
api-tests:
name: API Tests
needs: should_run_tests
if: needs.should_run_tests.outputs.shouldRunTests == 'true'
runs-on: ubuntu-22.04
env:
REDIS_URL: 'redis://:open-keystone-demo-password@localhost:6379'
strategy:
fail-fast: false
matrix:
index: [0, 1, 2, 3, 4, 5, 6, 7, 8]
adapter: ['mongoose', 'knex', 'prisma_postgresql']
node-version: [22.x, 24.x]
include:
- adapter: 'mongoose'
database_url: 'mongodb://admin:open-keystone-demo-password@localhost:27017/admin'
- adapter: 'knex'
database_url: 'postgres://postgres:open-keystone-demo-password@localhost:5432/main'
- adapter: 'prisma_postgresql'
database_url: 'postgres://postgres:open-keystone-demo-password@localhost:5432/main'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Start Docker Compose
run: docker compose up -d --wait
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install Dependencies
run: yarn --immutable
- name: Build packages
run: yarn build
- name: Unit tests
run: yarn jest --ci --maxWorkers=1 api-tests --forceExit
env:
CLOUDINARY_CLOUD_NAME: keystone-cloudinary
CLOUDINARY_KEY: 758252673115372
CLOUDINARY_SECRET: ${{ secrets.CLOUDINARY_SECRET }}
CI_NODE_TOTAL: 9
CI_NODE_INDEX: ${{ matrix.index }}
TEST_ADAPTER: ${{ matrix.adapter }}
DATABASE_URL: ${{ matrix.database_url }}
IFRAMELY_API_KEY: ${{ secrets.IFRAMELY_API_KEY }}
UNSPLASH_KEY: ${{ secrets.UNSPLASH_KEY}}
UNSPLASH_SECRET: ${{ secrets.UNSPLASH_SECRET}}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
non-api-tests:
name: Package Unit Tests
needs: should_run_tests
if: needs.should_run_tests.outputs.shouldRunTests == 'true'
runs-on: ubuntu-22.04
env:
DATABASE_URL: 'postgres://postgres:open-keystone-demo-password@localhost:5432/main'
strategy:
fail-fast: false
matrix:
node-version: [22.x, 24.x]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Start Docker Compose
run: docker compose up -d --wait
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install Dependencies
run: yarn --immutable
- name: Build packages
run: yarn build
- name: Unit tests
run: yarn jest --ci --maxWorkers=1 --testPathIgnorePatterns=api-tests --forceExit
env:
CLOUDINARY_CLOUD_NAME: keystone-cloudinary
CLOUDINARY_KEY: 758252673115372
CLOUDINARY_SECRET: ${{ secrets.CLOUDINARY_SECRET }}
linting:
name: Linting
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install Dependencies
run: yarn --immutable
- name: Prettier
run: yarn lint:prettier
- name: Preconstruct (build packages)
run: yarn build
- name: ESLint
run: yarn lint:eslint
- name: TypeScript
run: yarn lint:types
- name: Remark
run: yarn lint:markdown
cypress:
name: Cypress tests
needs: should_run_tests
if: needs.should_run_tests.outputs.shouldRunTests == 'true'
runs-on: ubuntu-22.04
env:
DATABASE_URL: 'postgres://postgres:open-keystone-demo-password@localhost:5432/main'
PORT: 3000
strategy:
fail-fast: false
matrix:
project:
- test-projects/basic
- test-projects/login
- test-projects/access-control
- test-projects/client-validation
node-version: [22.x, 24.x]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Start Docker Compose
run: docker compose up -d --wait
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install Dependencies
run: yarn --immutable
- name: Build packages
run: yarn build
- run: yarn --cwd tests/${{ matrix.project }} cypress install
- run: yarn --cwd tests/${{ matrix.project }} cypress:run:ci
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
path: cypress/videos