Skip to content

fix(compiler): custom elements relative typedef import paths #4586

fix(compiler): custom elements relative typedef import paths

fix(compiler): custom elements relative typedef import paths #4586

name: BrowserStack Tests
on:
merge_group:
pull_request_target:
branches:
- 'main'
- 'v3.*-feature'
- 'stencil/v4-dev'
push:
branches:
- 'main'
- 'stencil/v4-dev'
env:
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
permissions: read-all
# this workflow splits running Browserstack tests into two jobs:
# - one to build stencil for Browserstack
# - one to build the test applications & invoke Browserstack
#
# doing so allows us to balance a few different considerations when running against Browserstack:
# 1. Rerunning Failed Jobs
# Creating a separate job for running Browserstack on its own allows us to 'rerun failed jobs' in the GitHub UI,
# only for the Browserstack tests themselves.
# This allows for a quicker feedback loop in the event of flaky jobs
# 2. Secret Security
# In order to authenticate against Browserstack, an access key and username are required
# In order to minimize their access/usage elsewhere, we contain them to the workflow that is this file
#
# These items do come at a cost of some repeated steps in the jobs below (checking out code, installing dependencies,
# etc.)
jobs:
build_core:
name: Build for Browserstack
uses: ./.github/workflows/build.yml
run_browserstack:
name: Run Browserstack
runs-on: ubuntu-20.04
needs: [build_core]
# The concurrency field allows us to block multiple invocations of this job across multiple workflow runs.
# Stencil is only able to run 5 parallel tests in Browserstack, which is exceeded when more than one run of this
# workflow occurs - e.g. more than one pull request is submitted in proximity, a pull request and a merge to a
# branch that runs this workflow, etc.
#
# At this time, Karma is unable to properly wait for the queued Browserstack tests to finish. Instead, use the
# GitHub Actions 'concurrency' field as means to block the job until no other tests are running.
concurrency: run_browserstack_queue
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
ref: ${{ github.event_name == 'pull_request_target' && format('refs/pull/{0}/merge', github.event.number) || '' }}
persist-credentials: false
- name: Use Node Version from Volta (Karma)
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
# pull the version to use from the volta key in package.json
node-version-file: './test/karma/package.json'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Download Build Archive
uses: ./.github/workflows/actions/download-archive
with:
name: stencil-core
path: .
filename: stencil-core-build.zip
- name: BrowserStack Env Setup
uses: 'browserstack/github-actions/setup-env@master'
with:
username: ${{ env.BROWSERSTACK_USERNAME }}
access-key: ${{ env.BROWSERSTACK_ACCESS_KEY }}
project-name: 'stencil_core'
- name: Start BrowserStack
uses: browserstack/github-actions/setup-local@master
with:
# local-testing must be one of two values: 'start' or 'stop' to start/stop Browserstack
local-testing: start
# generates a random identifier for the Browserstack connection.
# otherwise, an identifier collision could cause connections to fail.
local-identifier: random
- name: Run Karma Tests
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3
with:
timeout_minutes: 15
max_attempts: 3
command: npm run test.karma.prod
- name: Stop BrowserStack
uses: browserstack/github-actions/setup-local@master
with:
# local-testing must be one of two values: 'start' or 'stop' to start/stop Browserstack
local-testing: stop
- name: Check Git Context
uses: ./.github/workflows/actions/check-git-context