Skip to content

Commit

Permalink
Setup the local BAAS upfront
Browse files Browse the repository at this point in the history
  • Loading branch information
takameyer committed Jun 17, 2023
1 parent d0a2b45 commit b844344
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/package-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ jobs:
name: ${{ matrix.workspace }} unit tests
runs-on: ubuntu-latest
steps:
- name: Generate server configuration
if: ${{matrix.use-baas}}
id: baas-config
run:
suffix=$(node -p 'Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)');
subdomain="realm-js-test-server-${{ github.run_id }}-${{ github.run_attempt }}-${suffix}";
echo "subdomain=${subdomain}" >> $GITHUB_OUTPUT;
echo "url=https://${subdomain}.ngrok.io" >> $GITHUB_OUTPUT;
- name: Trigger the test server workflow to start the server
if: ${{matrix.use-baas}}
run: gh workflow run test-server.yml -f ngrok_subdomain=${{ steps.baas-config.outputs.subdomain }} -f run_id=${{ github.run_id }}
env:
GH_TOKEN: ${{ github.token }}
- uses: actions/checkout@v3
with:
submodules: "recursive"
Expand All @@ -46,21 +59,6 @@ jobs:
- name: ccache
uses: hendrikmuhs/ccache-action@v1

- name: Generate server configuration
if: ${{matrix.use-baas}}
id: baas-config
run:
suffix=$(node -p 'Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)');
subdomain="realm-js-test-server-${{ github.run_id }}-${{ github.run_attempt }}-${suffix}";
echo "subdomain=${subdomain}" >> $GITHUB_OUTPUT;
echo "url=https://${subdomain}.ngrok.io" >> $GITHUB_OUTPUT;

- name: Trigger the test server workflow to start the server
if: ${{matrix.use-baas}}
run: gh workflow run test-server.yml -f ngrok_subdomain=${{ steps.baas-config.outputs.subdomain }} -f run_id=${{ github.run_id }}
env:
GH_TOKEN: ${{ github.token }}

- name: Set baas env
if: ${{matrix.use-baas}}
run: echo "REALM_BASE_URL=${{ steps.baas-config.outputs.url }}" >> $GITHUB_ENV
Expand Down

0 comments on commit b844344

Please sign in to comment.