Skip to content

Commit

Permalink
Migrating realm-web workflow to NPM workspaces & BaaSaaS (#6368)
Browse files Browse the repository at this point in the history
* Migrating realm-web workflow to NPM workspaces

* Update pr-realm-web.yml

* Refactored into a setup.ts file

* Upgrading Mocha

* Migrating from file-based app config to in-code

* Fixed import from mocha-remote

* Using makeRequestBodyIterable only on Node and React Native

* Adding interop on cjs outputs

* Upgrading webpack for realm-web-integration-tests

* Fixed importing security of an app

* Fixed serving realm-web from Webpack dev server

* Renamed MDB_REALM_ to BAAS_

* Using test-server workflow in pr-realm-web workflow

* Remove --ignore-scripts to help download a browser

* Migrating realm-web workflow to baasaas
  • Loading branch information
kraenhansen authored Jan 18, 2024
1 parent c8a9b18 commit ed3dbc7
Show file tree
Hide file tree
Showing 35 changed files with 431 additions and 451 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/pr-realm-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
- "packages/realm-app-importer/**"
# Changing types might also affect Realm Web
- "types/**"
# Or the workflow itself
- ".github/workflows/pr-realm-web.yml"
# No need to run when updating documentation
- "!**.md"

Expand All @@ -20,6 +22,7 @@ concurrency:

env:
REALM_DISABLE_ANALYTICS: 1
BAAS_BRANCH: master

jobs:
job:
Expand All @@ -32,27 +35,22 @@ jobs:
with:
node-version: 20
registry-url: https://registry.npmjs.org/
# Install the root package (--ignore-scripts to avoid downloading or building the native module)
- run: npm ci --ignore-scripts
# Bootstrap lerna sub-packages
- run: npx lerna bootstrap --scope realm-web-integration-tests --include-dependencies
# Install the root package
- run: npm ci
# Build and test the package
- run: npm run build
working-directory: packages/realm-web
- run: npm run bundle --workspace realm-web
- name: Run unit tests
run: npm test
working-directory: packages/realm-web
# Login with the Docker CLI to enable the integration test harness to pull the mongodb-realm-test-server
- name: Docker Login
uses: azure/docker-login@v1
run: npm test --workspace realm-web

- name: Start BaaS test server
id: baas
uses: ./.github/actions/baas-test-server
with:
login-server: ghcr.io
username: realm-ci
password: ${{ secrets.REALM_CI_GITHUB_API_KEY }}
branch: ${{ env.BAAS_BRANCH }}
env:
BAASAAS_KEY: ${{ secrets.BAASAAS_KEY }}

- name: Run integration tests
run: npm run test:github
working-directory: packages/realm-web-integration-tests
run: npm test --workspace realm-web-integration-tests
env:
AWS_ACCESS_KEY_ID: ${{ secrets.BAAS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.BAAS_AWS_SECRET_ACCESS_KEY }}
MONGODB_REALM_TEST_SERVER: "2023-02-22"
BAAS_BASE_URL: ${{ steps.baas.outputs.baas-url }}
Loading

0 comments on commit ed3dbc7

Please sign in to comment.