-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: CircleCI Monorepo setup (WIP)
- Loading branch information
1 parent
f6532ec
commit 345ae77
Showing
2 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: 2.1 | ||
|
||
# this allows you to use CircleCI's dynamic configuration feature | ||
setup: true | ||
|
||
# the path-filtering orb is required to continue a pipeline based on | ||
# the path of an updated fileset | ||
orbs: | ||
path-filtering: circleci/[email protected] | ||
|
||
workflows: | ||
# the always-run workflow is always triggered, regardless of the pipeline parameters. | ||
always-run: | ||
jobs: | ||
- path-filtering/filter: | ||
name: check-updated-files | ||
|
||
# Test which path is updated and set the parameter for continue_config | ||
mapping: | | ||
apps/backend/.* backend-changed true | ||
apps/web/.* web-changed true | ||
apps/mobile/.* mobile-changed true | ||
# Compare changes of the branch with main branch | ||
base-revision: main | ||
|
||
# this is the path of the configuration we should trigger once | ||
# path filtering and pipeline parameter value updates are | ||
# complete. In this case, we are using the parent dynamic | ||
# configuration itself. | ||
|
||
config-path: .circleci/continue_config.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
version: 2.1 | ||
|
||
commands: | ||
setup: | ||
steps: | ||
- run: | ||
command: | | ||
corepack enable --install-directory ~/bin | ||
yarn install | ||
# the default pipeline parameters, which will be updated according to | ||
# the results of the path-filtering orb | ||
parameters: | ||
backend-changed: | ||
type: boolean | ||
default: false | ||
web-changed: | ||
type: boolean | ||
default: false | ||
mobile-changed: | ||
type: boolean | ||
default: false | ||
|
||
workflows: | ||
run-backend-tests: | ||
when: << pipeline.parameters.backend-changed >> | ||
jobs: | ||
- backend-tests | ||
run-web-tests: | ||
when: << pipeline.parameters.web-changed >> | ||
jobs: | ||
- web-tests | ||
run-mobile-tests: | ||
when: << pipeline.parameters.mobile-changed >> | ||
jobs: | ||
- mobile-tests | ||
|
||
jobs: | ||
backend-tests: | ||
docker: | ||
- image: cimg/node:20.17 | ||
- image: cimg/postgres:13.4-postgis | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: hylo | ||
POSTGRES_DB: hylo_test | ||
- image: redis | ||
environment: | ||
NODE_ENV: test | ||
DATABASE_URL: postgres://localhost:5432/hylo_test | ||
DOMAIN: testdomain | ||
# this prevents jobs that were queued during testing from being run in development | ||
KUE_NAMESPACE: qtest | ||
PROTOCOL: http | ||
# don't log errors to Rollbar | ||
ROLLBAR_SERVER_TOKEN: 0 | ||
steps: | ||
- checkout | ||
- setup | ||
- run: | ||
command: | | ||
cd apps/backend | ||
yarn test | ||
web-tests: | ||
docker: | ||
- image: cimg/node:20.17 | ||
steps: | ||
- checkout | ||
- setup | ||
- run: | ||
command: | | ||
cd apps/web | ||
yarn test | ||
mobile-tests: | ||
docker: | ||
- image: cimg/node:20.17 | ||
steps: | ||
- checkout | ||
- setup | ||
- run: | ||
command: | | ||
cd apps/mobile | ||
yarn test |