Skip to content

handle empty arrays #2386

handle empty arrays

handle empty arrays #2386

Workflow file for this run

name: Test
on:
push:
branches-ignore:
- "release-please--**"
- "release/v**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PARABOL_BUILD_ENV_PATH: docker/images/parabol-ubi/environments/pipeline
jobs:
test:
runs-on: ubuntu-8cores
timeout-minutes: 30
permissions:
contents: "read"
id-token: "write"
services:
postgres:
image: pgvector/pgvector:0.7.0-pg16
# This env variables must be the same in the file PARABOL_BUILD_ENV_PATH
env:
POSTGRES_PASSWORD: "temppassword"
POSTGRES_USER: "tempuser"
POSTGRES_DB: "tempdb"
ports:
- 5432:5432
rethinkdb:
image: rethinkdb:2.4.2
ports:
- 8080:8080
- 28015:28015
- 29015:29015
redis:
image: redis:7.0-alpine
ports:
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: package.json
# Caching yarn dir & running yarn install is too slow
# Instead, we aggressively cache node_modules below to avoid calling install
- name: Setup environment variables
run: |
ACTION_VERSION=$(grep '"version":' package.json | cut -d\" -f4)
echo ACTION_VERSION=$ACTION_VERSION >> $GITHUB_ENV
echo ACTION_VERSION=$ACTION_VERSION
NODE_VERSION=$(jq -r -j '.engines.node|ltrimstr("^")' package.json)
echo NODE_VERSION=$NODE_VERSION >> $GITHUB_ENV
echo NODE_VERSION=$NODE_VERSION
PLAYWRIGHT_VERSION=$(yarn list @playwright/test | grep @playwright | sed 's/.*@//')
echo PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION >> $GITHUB_ENV
echo PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION
- name: Get cached node modules
id: cache
uses: actions/cache@v3
with:
path: |
**/node_modules
key: node_modules-${{ runner.arch }}-${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: Install node_modules
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable
- name: Build the DBs
run: |
cp ${{ env.PARABOL_BUILD_ENV_PATH }} ./.env
yarn db:migrate
yarn pg:migrate up
yarn pg:build
- name: Build for testing
run: yarn build
- name: Verify source is clean
run: git diff --quiet HEAD || (echo "Changes in generated files detected"; git diff; exit 1)
- name: Run Predeploy for Testing
run: yarn predeploy
- name: Start testing server in background
uses: JarvusInnovations/background-action@v1
with:
run: |
yarn start &
wait-on: |
http://localhost:3000/graphql
- name: Kysely Codegen
run: yarn pg:generate
- name: Typecheck
run: yarn typecheck
- name: Run server tests
run: yarn test:server -- --reporters=default --reporters=jest-junit
env:
JEST_JUNIT_OUTPUT_DIR: ./test-results/junit/server
- name: Run client tests
run: yarn test:client -- --reporters=default --reporters=jest-junit
env:
JEST_JUNIT_OUTPUT_DIR: ./test-results/junit/client
- name: Cache Playwright Browsers
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.arch }}-${{ env.PLAYWRIGHT_VERSION }}
- name: Setup Playwright
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Run Playwright Tests
run: yarn workspace integration-tests test --reporter list,junit
env:
PLAYWRIGHT_JUNIT_OUTPUT_NAME: ./test-results/junit/junit.xml
- name: Store Artifacts from Failed Tests
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: packages/integration-tests/test-results/
retention-days: 7
- name: Report Status
if: ${{ failure() && github.ref_name == 'master' }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GH_ACTIONS_NOTIFICATIONS }}