feat(core): Write module injections to globalThis
#1337
Workflow file for this run
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
name: Checks | |
on: | |
push: | |
branches: | |
- main | |
- release/** | |
pull_request: | |
jobs: | |
build: | |
name: Build packages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "package.json" | |
- name: Use dependency cache | |
uses: actions/cache@v4 | |
id: dependency-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Use build cache | |
uses: actions/cache@v4 | |
with: | |
path: .nxcache | |
key: build-cache-key-${{ runner.os }}-${{ github.run_id }} | |
restore-keys: | | |
build-cache-key-${{ runner.os }}- | |
- name: Install dependencies | |
run: yarn --frozen-lockfile --ignore-engines | |
if: steps.dependency-cache.outputs.cache-hit != 'true' | |
- run: yarn build | |
type-check: | |
needs: build | |
name: Typing check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "package.json" | |
- name: Use dependency cache | |
uses: actions/cache@v4 | |
id: dependency-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Use build cache | |
uses: actions/cache@v4 | |
with: | |
path: .nxcache | |
key: build-cache-key-${{ runner.os }}-${{ github.run_id }} | |
restore-keys: | | |
build-cache-key-${{ runner.os }}- | |
- name: Install dependencies | |
run: yarn --frozen-lockfile --ignore-engines | |
if: steps.dependency-cache.outputs.cache-hit != 'true' | |
- run: yarn check:types | |
formatting-check: | |
name: Formatting check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "package.json" | |
- name: Use dependency cache | |
uses: actions/cache@v4 | |
id: dependency-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Use build cache | |
uses: actions/cache@v4 | |
with: | |
path: .nxcache | |
key: build-cache-key-${{ runner.os }}-${{ github.run_id }} | |
restore-keys: | | |
build-cache-key-${{ runner.os }}- | |
- name: Install dependencies | |
run: yarn --frozen-lockfile --ignore-engines | |
if: steps.dependency-cache.outputs.cache-hit != 'true' | |
- run: yarn check:formatting | |
test-unit: | |
needs: build | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "package.json" | |
- name: Use dependency cache | |
uses: actions/cache@v4 | |
id: dependency-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Use build cache | |
uses: actions/cache@v4 | |
with: | |
path: .nxcache | |
key: build-cache-key-${{ runner.os }}-${{ github.run_id }} | |
restore-keys: | | |
build-cache-key-${{ runner.os }}- | |
- name: Install dependencies | |
run: yarn --frozen-lockfile --ignore-engines | |
if: steps.dependency-cache.outputs.cache-hit != 'true' | |
- run: yarn test:unit | |
test-integration: | |
needs: build | |
name: "Integration Tests (Node ${{ matrix.node-version }}, OS ${{ matrix.os }})" | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: [ | |
# nx uses a `yargs-parser` versision which isn't compatible with node 10 | |
# "10.24.1", | |
# vite uses optional chaining which isn't compatible with node 12 | |
# "12.22.12", | |
"14.21.1", | |
"16.18.1", | |
"18.12.1", | |
] | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Use dependency cache | |
uses: actions/cache@v4 | |
id: dependency-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Use build cache | |
uses: actions/cache@v4 | |
with: | |
path: .nxcache | |
key: build-cache-key-${{ runner.os }}-${{ github.run_id }} | |
restore-keys: | | |
build-cache-key-${{ runner.os }}- | |
- name: Install dependencies | |
run: yarn --frozen-lockfile --ignore-engines | |
if: steps.dependency-cache.outputs.cache-hit != 'true' | |
- run: yarn test:integration | |
test-e2e: | |
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks | |
# Dependabot PRs sadly also don't have access to secrets, so we skip them as well | |
if: | |
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && | |
github.actor != 'dependabot[bot]' && | |
false # Debug ID backend changes broke the E2E tests, we need to revisit them | |
needs: build | |
name: E2E Tests | |
runs-on: ubuntu-latest | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.E2E_TESTS_SENTRY_AUTH_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: volta-cli/action@v3 | |
- name: Use dependency cache | |
uses: actions/cache@v4 | |
id: dependency-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Use build cache | |
uses: actions/cache@v4 | |
with: | |
path: .nxcache | |
key: build-cache-key-${{ runner.os }}-${{ matrix.target }}-${{ matrix.jobIndex }}-${{ github.run_id }} | |
restore-keys: | | |
build-cache-key-${{ runner.os }}-${{ matrix.target }}-${{ matrix.jobIndex }}- | |
- name: Install dependencies | |
run: yarn --frozen-lockfile --ignore-engines | |
if: steps.dependency-cache.outputs.cache-hit != 'true' | |
- run: yarn test:e2e | |
lint: | |
needs: build | |
name: Linter check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "package.json" | |
- name: Use dependency cache | |
uses: actions/cache@v4 | |
id: dependency-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- name: Use build cache | |
uses: actions/cache@v4 | |
with: | |
path: .nxcache | |
key: build-cache-key-${{ runner.os }}-${{ github.run_id }} | |
restore-keys: | | |
build-cache-key-${{ runner.os }}- | |
- name: Install dependencies | |
run: yarn --frozen-lockfile --ignore-engines | |
if: steps.dependency-cache.outputs.cache-hit != 'true' | |
- run: yarn lint | |
artifacts: | |
needs: build | |
name: Upload Artifacts | |
runs-on: ubuntu-latest | |
# Build artifacts are only needed for releasing workflow. | |
if: startsWith(github.ref, 'refs/heads/release/') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: "package.json" | |
- name: Install dependencies | |
run: yarn --frozen-lockfile | |
- name: pack | |
run: yarn build:npm | |
- name: archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.sha }} | |
path: | | |
${{ github.workspace }}/packages/*/dist/** | |
${{ github.workspace }}/packages/**/*.tgz |