Skip to content

Commit

Permalink
Merge remote-tracking branch 'core/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
ludtkemorgan committed Feb 18, 2024
2 parents dcb7a8a + c9b6a06 commit cab0e59
Show file tree
Hide file tree
Showing 625 changed files with 83,084 additions and 3,319 deletions.
221 changes: 132 additions & 89 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
version: 2.1
orbs:
cypress: cypress-io/[email protected]
node: circleci/node@5

executors:
standard-node:
docker:
- image: "cimg/node:18.14.2"
- image: "cimg/postgres:12.10"
environment:
POSTGRES_USER: bloom-ci
# Never do this in production or with any sensitive / non-test data:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: bloom
cypress-node:
docker:
- image: "cypress/base:18.14.1"
Expand All @@ -21,15 +12,29 @@ executors:
# Never do this in production or with any sensitive / non-test data:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: bloom
JURISDICTION_NAME: Bloomington
environment:
PORT: "3100"
EMAIL_API_KEY: "SG.SOME-LONG-SECRET-KEY"
APP_SECRET: "CI-LONG-SECRET-KEY"
NODE_ENV: "development"
# DB URL for migration and seeds:
DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom"
# DB URL for the jest tests per ormconfig.test.ts
TEST_DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom"
PARTNERS_PORTAL_URL: "http://localhost:3001"
JURISDICTION_NAME: Bloomington
standard-node:
docker:
- image: "cimg/node:18.14.2"
- image: "cimg/postgres:12.10"
environment:
POSTGRES_USER: bloom-ci
# Never do this in production or with any sensitive / non-test data:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: bloom_prisma
JURISDICTION_NAME: Bloomington

jobs:
setup:
executor: standard-node
Expand All @@ -40,48 +45,95 @@ jobs:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/
setup-with-db:
executor: standard-node
steps:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:backend:core:dbsetup
lint:
setup-backend:
executor: standard-node
steps:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn lint
jest-shared-helpers:
executor: standard-node
- checkout
- run: yarn backend:new:install
- save_cache:
key: build-cache-new-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/
cypress-public:
executor: cypress-node
resource_class: large
steps:
- checkout
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:shared:helpers
jest-backend:
executor: standard-node
- node/install-packages:
app-dir: sites/public
pkg-manager: yarn
cache-version: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- node/install-packages:
app-dir: api
pkg-manager: yarn
cache-version: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: setup db and seed
command: yarn test:backend:new:dbsetup:withseed
- run:
name: run backend
command: yarn dev
background: true
working_directory: api
- run:
name: build and run public
command: yarn dev:server-wait-new && yarn build && yarn start
background: true
working_directory: sites/public
- run:
name: wait
command: yarn dev:public-wait
working_directory: sites/public
- run:
name: Run Cypress
command: npx cypress run
working_directory: sites/public
- store_artifacts:
path: sites/public/cypress/videos
- store_artifacts:
path: sites/public/cypress/screenshots
cypress-partners:
executor: cypress-node
resource_class: large
steps:
- checkout
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- node/install-packages:
app-dir: sites/partners
pkg-manager: yarn
cache-version: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- node/install-packages:
app-dir: api
pkg-manager: yarn
cache-version: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: DB Setup + Backend Core Tests
command: |
yarn test:backend:core:dbsetup
yarn test:backend:core
yarn test:e2e:backend:core
environment:
PORT: "3100"
EMAIL_API_KEY: "SG.SOME-LONG-SECRET-KEY"
APP_SECRET: "CI-LONG-SECRET-KEY"
# DB URL for migration and seeds:
DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom"
# DB URL for the jest tests per ormconfig.test.ts
TEST_DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom"
CLOUDINARY_SIGNED_PRESET: "fake_secret"
CLOUDINARY_KEY: "fake_key"
CLOUDINARY_CLOUD_NAME: "exygy"
CLOUDINARY_SECRET: "fake_secret"
PARTNERS_PORTAL_URL: "http://localhost:3001"
name: setup db and seed
command: yarn test:backend:new:dbsetup:withseed
- run:
name: run backend
command: yarn dev
background: true
working_directory: api
- run:
name: build and run partners
command: yarn dev:server-wait-new && yarn build && yarn start
background: true
working_directory: sites/partners
- run:
name: wait
command: yarn dev:partners-wait
working_directory: sites/partners
- run:
name: Run Cypress
command: npx cypress run
working_directory: sites/partners
- store_artifacts:
path: sites/partners/cypress/videos
- store_artifacts:
path: sites/partners/cypress/screenshots
build-public:
executor: standard-node
steps:
Expand All @@ -106,21 +158,50 @@ jobs:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:app:public:unit
lint:
executor: standard-node
steps:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn lint
jest-shared-helpers:
executor: standard-node
steps:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:shared:helpers
jest-backend:
executor: standard-node
steps:
- checkout
- restore_cache:
key: build-cache-new-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: DB Setup + New Backend Core Tests
working_directory: api
command: |
yarn install
yarn test:cov-ci
environment:
PORT: "3100"
EMAIL_API_KEY: "SG.SOME-LONG-SECRET-KEY"
APP_SECRET: "CI-LONG-SECRET-KEY"
# DB URL for migration and seeds:
DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom_prisma"


workflows:
version: 2
build:
jobs:
- setup
- setup-backend
- lint:
requires:
- setup
- jest-shared-helpers:
requires:
- setup
- jest-backend:
requires:
- setup
- jest-backend
- build-public:
requires:
- setup
Expand All @@ -133,49 +214,11 @@ workflows:
- unit-test-partners:
requires:
- setup
- cypress/run:
name: "cypress-public"
- cypress-public:
requires:
- setup
executor: cypress-node
working_directory: sites/public
yarn: true
build: |
yarn test:backend:core:dbsetup
start: yarn dev:all-cypress
wait-on: "http://0.0.0.0:3000"
store_artifacts: true
- cypress/run:
name: "cypress-partners"
- setup-backend
- cypress-partners:
requires:
- setup
executor: cypress-node
working_directory: sites/partners
yarn: true
build: |
echo 'export FEATURE_LISTINGS_APPROVAL=FALSE' >> "$BASH_ENV"
source "$BASH_ENV"
yarn test:backend:core:dbsetup
start: |
yarn dev:all-cypress
command: |
npx cypress run --spec cypress/e2e/default/**/*.{js,jsx,ts,tsx}
wait-on: "http://0.0.0.0:3001"
store_artifacts: true
- cypress/run:
name: "cypress-partners-listings-approval"
requires:
- setup
executor: cypress-node
working_directory: sites/partners
yarn: true
build: |
echo 'export FEATURE_LISTINGS_APPROVAL=TRUE' >> "$BASH_ENV"
source "$BASH_ENV"
yarn test:backend:core:dbsetup
start: |
yarn dev:all-cypress
command: |
npx cypress run --spec cypress/e2e/listings-approval/**/*.{js,jsx,ts,tsx}
wait-on: "http://0.0.0.0:3001"
store_artifacts: true
- setup-backend
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = {
"plugin:import/typescript",
"plugin:react-hooks/recommended", // Make sure we follow https://reactjs.org/docs/hooks-rules.html
"plugin:jsx-a11y/recommended",
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
rules: {
Expand All @@ -26,6 +25,7 @@ module.exports = {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-var-requires": "off",
"react/jsx-uses-vars": "warn",
"react/jsx-uses-react": "warn",
"@typescript-eslint/restrict-template-expressions": [
Expand All @@ -43,12 +43,14 @@ module.exports = {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/ban-ts-comment": "off",
},
ignorePatterns: [
"node_modules",
"storybook-static",
".next",
"dist",
"api",
"migration/",
"**/*.stories.tsx",
"**/.eslintrc.js",
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/version_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Version packages

on:
# Triggers the workflow on push only for the main branch
push:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Config user name
run: git config --global user.name github.context.workflow

- name: Config user email
run: git config --global user.email "[email protected]"

- name: Check out git repo
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.ADMIN_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'

- name: Version packages
run: yarn version:all
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }}
Loading

0 comments on commit cab0e59

Please sign in to comment.