fix: small summary view issues (#1744) #4426
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
# create-gui-pr.yaml is dependant on this name being "Tests" | |
name: 'Tests' | |
# | |
on: | |
push: | |
branches: [master, 'release-[0-9]+.[0-9]+'] | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
install-dependencies: | |
runs-on: ubuntu-latest | |
outputs: | |
spec_groups: ${{ steps.set-groups.outputs.groups }} | |
spec_group_ids: ${{ steps.set-group-ids.outputs.group_ids }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- uses: actions/cache@v3 | |
id: node-modules-cache | |
with: | |
path: | | |
**/node_modules | |
/home/runner/.cache | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
run: | | |
yarn install --frozen-lockfile | |
yarn run lint:lockfile | |
yarn deps | |
- id: set-groups | |
env: | |
THREAD_COUNT: 5 | |
run: echo "groups=$(find features -type f -name '*.feature' | xargs -n $(($(find features -type f -name '*.feature' | wc -l) / $THREAD_COUNT + 1)) | tr ' ' ',' | jq -R . | jq -s -cM .)" >> $GITHUB_OUTPUT | |
- id: set-group-ids | |
env: | |
SPEC_GROUPS: ${{ steps.set-groups.outputs.groups }} | |
run: echo "group_ids=$(echo $SPEC_GROUPS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT | |
lint-tests: | |
needs: [install-dependencies] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- uses: actions/cache/restore@v3 | |
id: node-modules-cache | |
with: | |
path: | | |
**/node_modules | |
/home/runner/.cache | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- env: | |
LINTER_MODE: strict | |
run: | | |
yarn run lint | |
yarn run lint:ts | |
yarn run lint:styles | |
cli-tests: | |
needs: [install-dependencies] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- uses: actions/cache/restore@v3 | |
id: node-modules-cache | |
with: | |
path: | | |
**/node_modules | |
/home/runner/.cache | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- run: | | |
yarn run test | |
browser-tests: | |
needs: [install-dependencies] | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
container: ${{ fromJSON(needs.install-dependencies.outputs.spec_group_ids) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- uses: actions/cache/restore@v3 | |
id: node-modules-cache | |
with: | |
path: | | |
**/node_modules | |
/home/runner/.cache | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- run: | | |
yarn build:staging | |
- env: | |
SPEC_GROUPS: ${{ needs.install-dependencies.outputs.spec_groups }} | |
run: | | |
yarn preview:built & | |
CYPRESS_video=true yarn run test:browser --spec $(echo $SPEC_GROUPS | jq -cMr '.[${{ matrix.container }}]') | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: cypress-artifacts | |
retention-days: ${{ github.event_name == 'pull_request' && 3 || 30 }} | |
path: | | |
cypress/screenshots | |
cypress/videos | |
post-checks: | |
# There is a branch protection rule on the repo that requires "branch-protection" to | |
# be successful | |
name: branch-protection | |
# | |
needs: | |
- lint-tests | |
- cli-tests | |
- browser-tests | |
runs-on: ubuntu-latest | |
if: | | |
always() | |
steps: | |
- name: Check for failures | |
if: | | |
contains(needs.*.result, 'failure') || | |
contains(needs.*.result, 'cancelled') | |
run: echo '${{toJSON(needs)}}' && exit 1 | |
- run: echo "Successful" |