Skip to content

feat(integrations): add support for Garmin OAuth2 #30467

feat(integrations): add support for Garmin OAuth2

feat(integrations): add support for Garmin OAuth2 #30467

Workflow file for this run

name: Run Unit & Integration Tests
on:
push:
branches:
- master
- staging/**
pull_request:
merge_group:
concurrency:
group: tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
should-run:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.check.outputs.should_skip }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v4
id: filter
with:
predicate-quantifier: 'every'
filters: |
docs_only:
- 'docs/**'
non_docs:
- '**'
- '!docs/**'
- name: Determine if should skip
id: check
run: |
# Run on PRs only if not docs only
# Always run on merge queue
# Always run on direct pushes to master (not merge queue bot)
IS_PR="${{ github.event_name == 'pull_request' }}"
IS_MERGE_QUEUE="${{ github.event_name == 'merge_group' }}"
IS_DIRECT_PUSH_TO_MASTER="${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.actor != 'github-merge-queue[bot]' }}"
IS_DOCS_ONLY="${{ steps.filter.outputs.docs_only == 'true' && steps.filter.outputs.non_docs != 'true' }}"
SHOULD_SKIP="true"
# Always run on merge queue and direct push to master
if [[ "$IS_MERGE_QUEUE" == "true" || "$IS_DIRECT_PUSH_TO_MASTER" == "true" ]]; then
SHOULD_SKIP="false"
# Run on PR only if not docs only
elif [[ "$IS_PR" == "true" && "$IS_DOCS_ONLY" != "true" ]]; then
SHOULD_SKIP="false"
fi
echo "should_skip=$SHOULD_SKIP" >> $GITHUB_OUTPUT
tests-unit:
needs: should-run
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
if: needs.should-run.outputs.should_skip != 'true'
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Use Node.js
if: needs.should-run.outputs.should_skip != 'true'
uses: ./.github/actions/setup-node
- run: npm ci
if: needs.should-run.outputs.should_skip != 'true'
- run: npm run ts-build -- --noCheck
if: needs.should-run.outputs.should_skip != 'true'
- run: npm run test:unit -- --exclude packages/cli/
if: needs.should-run.outputs.should_skip != 'true'
# Integration tests run fully serially within a process (shared Postgres/ES),
# so we shard the file set across parallel runners to cut wall-clock time.
# Each shard spins up its own containers and stays internally serial.
tests-integration-shards:
needs: should-run
runs-on: blacksmith-4vcpu-ubuntu-2404
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- name: Checkout
if: needs.should-run.outputs.should_skip != 'true'
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Use Node.js
if: needs.should-run.outputs.should_skip != 'true'
uses: ./.github/actions/setup-node
- run: npm ci
if: needs.should-run.outputs.should_skip != 'true'
- run: npm run ts-build
if: needs.should-run.outputs.should_skip != 'true'
- run: npm run test:integration -- --shard=${{ matrix.shard }}/4
if: needs.should-run.outputs.should_skip != 'true'
# Aggregates the sharded runs into the single `tests-integration` required status check.
tests-integration:
needs: [should-run, tests-integration-shards]
if: always()
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Verify all integration shards passed
run: |
result="${{ needs.tests-integration-shards.result }}"
if [[ "$result" == "success" || "$result" == "skipped" ]]; then
echo "Integration shards: $result"
exit 0
fi
echo "Integration shards did not pass: $result"
exit 1
tests-connect-ui:
needs: should-run
# Accessibility regression suite. connect-ui renders design-system components, so a
# design-system change can regress contrast/focus too — run on any non-docs change.
if: needs.should-run.outputs.should_skip != 'true'
runs-on: blacksmith-4vcpu-ubuntu-2404
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Use Node.js
uses: ./.github/actions/setup-node
- run: npm ci
# connect-ui imports @nangohq/types and @nangohq/frontend; build their dist first.
- run: npm run ts-build -- --noCheck
# Browser Mode needs the Chromium binary (ignore-scripts blocks the postinstall download).
- run: npx playwright install --with-deps chromium
- run: npm test -w packages/connect-ui