chore(deps): bump focus-trap from 6.7.1 to 7.6.2 #927
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
# TODO(billy): this workflow has not been re-named from `acceptance` because | |
# Visual Snapshots compares against artifacts from the same workflow name (on main branch) | |
# We should rename this when we have a more finalized naming scheme. | |
# | |
# Also note that this name *MUST* match the filename because GHA | |
# only provides the workflow name (https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables) | |
# and GH APIs only support querying by workflow *FILENAME* (https://developer.github.com/v3/actions/workflows/#get-a-workflow) | |
name: acceptance | |
on: | |
push: | |
branches: | |
- master | |
- releases/** | |
pull_request: | |
jobs: | |
files-changed: | |
name: detect what files changed | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 3 | |
# Map a step output to a job output | |
outputs: | |
acceptance: ${{ steps.changes.outputs.acceptance }} | |
backend: ${{ steps.changes.outputs.backend }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check for backend file changes | |
uses: getsentry/paths-filter@v2 | |
id: changes | |
with: | |
token: ${{ github.token }} | |
filters: .github/file-filters.yml | |
frontend: | |
needs: files-changed | |
name: frontend tests | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 20 | |
strategy: | |
# This helps not having to run multiple jobs because one fails, thus, reducing resource usage | |
# and reducing the risk that one of many runs would turn red again (read: intermittent tests) | |
fail-fast: false | |
matrix: | |
# XXX: When updating this, make sure you also update CI_NODE_TOTAL. | |
instance: [0, 1, 2, 3] | |
env: | |
VISUAL_HTML_ENABLE: 1 | |
steps: | |
- uses: actions/checkout@v2 | |
name: Checkout sentry | |
with: | |
# Avoid codecov error message related to SHA resolution: | |
# https://github.com/codecov/codecov-bash/blob/7100762afbc822b91806a6574658129fe0d23a7d/codecov#L891 | |
fetch-depth: '2' | |
- uses: volta-cli/action@v1 | |
# See https://github.com/actions/cache/blob/master/examples.md#node---yarn for example | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 # We are explicitly using v1 due to perf reasons | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-v2-yarn-${{ hashFiles('yarn.lock', 'api-docs/yarn.lock') }} | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build CSS | |
run: NODE_ENV=production yarn build-css | |
- name: jest | |
env: | |
GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
GITHUB_PR_REF: ${{ github.event.pull_request.head.ref || github.ref }} | |
# XXX: CI_NODE_TOTAL must be hardcoded to the length of strategy.matrix.instance. | |
# Otherwise, if there are other things in the matrix, using strategy.job-total | |
# wouldn't be correct. | |
CI_NODE_TOTAL: 4 | |
CI_NODE_INDEX: ${{ matrix.instance }} | |
run: | | |
JEST_TESTS=$(yarn -s jest --listTests --json) yarn test-ci --forceExit | |
- name: Save HTML artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
retention-days: 14 | |
name: jest-html | |
path: .artifacts/visual-snapshots/jest | |
- name: Create Images from HTML | |
uses: getsentry/action-html-to-image@main | |
with: | |
base-path: .artifacts/visual-snapshots/jest | |
css-path: src/sentry/static/sentry/dist/entrypoints/sentry.css | |
- name: Save snapshots | |
uses: getsentry/action-visual-snapshot@v2 | |
with: | |
save-only: true | |
snapshot-path: .artifacts/visual-snapshots | |
- name: Handle artifacts | |
uses: ./.github/actions/artifacts | |
with: | |
files: .artifacts/coverage/* | |
type: frontend | |
webpack: | |
needs: files-changed | |
name: create frontend bundle | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 10 | |
outputs: | |
dist-path: ${{ steps.config.outputs.dist-path }} | |
steps: | |
- uses: actions/checkout@v2 | |
name: Checkout sentry | |
- uses: volta-cli/action@v1 | |
- name: Step configurations | |
id: config | |
run: | | |
echo "::set-output name=yarn-path::$(yarn cache dir)" | |
echo "::set-output name=webpack-path::.webpack_cache" | |
echo "::set-output name=dist-path::src/sentry/static/sentry/dist" | |
- name: yarn cache | |
uses: actions/cache@v1 # We are explicitly using v1 due to perf reasons | |
with: | |
path: ${{ steps.config.outputs.yarn-path }} | |
key: ${{ runner.os }}-v2-yarn-${{ hashFiles('yarn.lock', 'api-docs/yarn.lock') }} | |
- name: webpack cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.config.outputs.webpack-path }} | |
key: ${{ runner.os }}-v2-webpack-cache-${{ hashFiles('webpack.config.ts') }} | |
- name: Install Javascript Dependencies | |
run: | | |
yarn install --frozen-lockfile | |
- name: webpack | |
env: | |
WEBPACK_CACHE_PATH: ${{ steps.config.outputs.webpack-path }} | |
SENTRY_INSTRUMENTATION: 1 | |
# this is fine to not have for forks, it shouldn't fail | |
SENTRY_WEBPACK_WEBHOOK_SECRET: ${{ secrets.SENTRY_WEBPACK_WEBHOOK_SECRET }} | |
run: | | |
yarn build-acceptance | |
# Bundle dist for faster uploading | |
- name: bundle dist | |
run: | | |
tar czf dist.tar.gz ${{ steps.config.outputs.dist-path }} | |
- name: Save frontend dist | |
uses: actions/upload-artifact@v2 | |
with: | |
retention-days: 3 | |
name: frontend-dist | |
path: dist.tar.gz | |
acceptance: | |
needs: files-changed | |
name: acceptance | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 20 | |
strategy: | |
# This helps not having to run multiple jobs because one fails, thus, reducing resource usage | |
# and reducing the risk that one of many runs would turn red again (read: intermittent tests) | |
fail-fast: false | |
matrix: | |
python-version: [3.8.12] | |
# XXX: When updating this, make sure you also update MATRIX_INSTANCE_TOTAL. | |
instance: [0, 1, 2, 3] | |
pg-version: ['9.6', '14'] | |
env: | |
# XXX: MATRIX_INSTANCE_TOTAL must be hardcoded to the length of strategy.matrix.instance. | |
MATRIX_INSTANCE_TOTAL: 4 | |
VISUAL_SNAPSHOT_ENABLE: 1 | |
TEST_GROUP_STRATEGY: roundrobin | |
steps: | |
- name: Checkout sentry | |
uses: actions/checkout@v2 | |
- name: Setup sentry env (python ${{ matrix.python-version }}) | |
uses: ./.github/actions/setup-sentry | |
id: setup | |
with: | |
python-version: ${{ matrix.python-version }} | |
pip-cache-version: ${{ secrets.PIP_CACHE_VERSION }} | |
snuba: true | |
pg-version: ${{ matrix.pg-version }} | |
- name: Wait for frontend build | |
uses: getsentry/action-wait-for-check@v1.0.0 | |
id: wait-for-frontend | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
checkName: create frontend bundle | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
- name: Download frontend dist | |
uses: actions/download-artifact@v2 | |
with: | |
name: frontend-dist | |
- name: Extract dist | |
run: | | |
tar xf dist.tar.gz | |
- name: Run acceptance tests (#${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }}) | |
run: | | |
mkdir -p ${{ steps.setup.outputs.acceptance-dir }} | |
mkdir -p ${{ steps.setup.outputs.acceptance-dir }}-mobile | |
mkdir -p ${{ steps.setup.outputs.acceptance-dir }}-tooltips | |
make run-acceptance | |
env: | |
PYTEST_SNAPSHOTS_DIR: ${{ steps.setup.outputs.acceptance-dir }} | |
USE_SNUBA: 1 | |
- name: Save snapshots | |
uses: getsentry/action-visual-snapshot@v2 | |
with: | |
save-only: true | |
snapshot-path: .artifacts/visual-snapshots | |
- name: Handle artifacts | |
uses: ./.github/actions/artifacts | |
if: ${{ needs.files-changed.outputs.backend == 'true' }} | |
chartcuterie: | |
needs: files-changed | |
name: chartcuterie integration | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 30 | |
strategy: | |
# This helps not having to run multiple jobs because one fails, thus, reducing resource usage | |
# and reducing the risk that one of many runs would turn red again (read: intermittent tests) | |
fail-fast: false | |
matrix: | |
python-version: [3.8.12] | |
# XXX: When updating this, make sure you also update MATRIX_INSTANCE_TOTAL. | |
instance: [0] | |
env: | |
# XXX: MATRIX_INSTANCE_TOTAL must be hardcoded to the length of strategy.matrix.instance. | |
MATRIX_INSTANCE_TOTAL: 1 | |
TEST_GROUP_STRATEGY: roundrobin | |
VISUAL_SNAPSHOT_ENABLE: 1 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# Avoid codecov error message related to SHA resolution: | |
# https://github.com/codecov/codecov-bash/blob/7100762afbc822b91806a6574658129fe0d23a7d/codecov#L891 | |
fetch-depth: '2' | |
- name: Setup sentry env (python ${{ matrix.python-version }}) | |
uses: ./.github/actions/setup-sentry | |
id: setup | |
with: | |
python-version: ${{ matrix.python-version }} | |
pip-cache-version: ${{ secrets.PIP_CACHE_VERSION }} | |
chartcuterie: true | |
- name: yarn cache | |
uses: actions/cache@v1 # We are explicitly using v1 due to perf reasons | |
with: | |
path: ${{ steps.setup.outputs.yarn-cache-dir }} | |
key: ${{ runner.os }}-v2-yarn-${{ hashFiles('yarn.lock', 'api-docs/yarn.lock') }} | |
- name: Install Javascript Dependencies | |
run: | | |
yarn install --frozen-lockfile | |
- name: Build chartcuterie configuration module | |
run: | | |
make build-chartcuterie-config | |
- name: Run chartcuterie tests (${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }}) | |
run: | | |
mkdir -p ${{ steps.setup.outputs.acceptance-dir }} | |
make test-chartcuterie | |
env: | |
PYTEST_SNAPSHOTS_DIR: ${{ steps.setup.outputs.acceptance-dir }} | |
- name: Save snapshots | |
uses: getsentry/action-visual-snapshot@v2 | |
with: | |
save-only: true | |
snapshot-path: .artifacts/visual-snapshots | |
- name: Handle artifacts | |
uses: ./.github/actions/artifacts | |
if: ${{ needs.files-changed.outputs.backend == 'true' }} | |
visual-diff: | |
# This guarantees that we will only schedule Visual Snapshots if all | |
# workflows that generate artifacts succeed | |
needs: [acceptance, frontend, chartcuterie] | |
name: triggers visual snapshot | |
# This is necessary since a failed/skipped dependent job would cause this job to be skipped | |
if: always() | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 20 | |
steps: | |
# If any jobs we depend on fail, we will fail since this checks triggers Visual Snapshots which is a required check | |
- name: Check for failures | |
if: contains(needs.*.result, 'failure') | |
run: | | |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1 | |
- name: Diff snapshots | |
id: visual-snapshots-diff | |
uses: getsentry/action-visual-snapshot@v2 | |
# Do not execute on forks or on master. Forks are handled in visual-diff.yml | |
if: github.head_repository.full_name == 'getsentry/sentry' && github.ref != 'refs/heads/master' | |
with: | |
api-token: ${{ secrets.VISUAL_SNAPSHOT_SECRET }} | |
gcs-bucket: 'sentry-visual-snapshots' | |
gcp-service-account-key: ${{ secrets.SNAPSHOT_GOOGLE_SERVICE_ACCOUNT_KEY }} |