Skip to content

Commit 8269a69

Browse files
committed
Merge tag 'v2.20.1' into spring-23-opensource
2 parents 523863f + b4936a9 commit 8269a69

File tree

195 files changed

+2400
-1785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+2400
-1785
lines changed

.circleci/config.yml

Lines changed: 7 additions & 503 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: build-tokens
2+
runs:
3+
using: composite
4+
steps:
5+
- name: Build Tokens
6+
run: npm run gulp -- generate:tokens:all
7+
shell: bash
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: copy-tokens-from-workspace
2+
runs:
3+
using: composite
4+
steps:
5+
- name: Decompress design-tokens
6+
run: tar -xvf workspace/artifact/design-tokens.tar
7+
shell: bash
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: copy-tokens-to-workspace
2+
runs:
3+
using: composite
4+
steps:
5+
- name: Compress design-tokens
6+
run: tar -cvf workspace/design-tokens.tar design-tokens/
7+
shell: bash
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: set-heroku-app-name
2+
outputs:
3+
HEROKU_APP_NAME:
4+
value: ${{ steps.which-app.outputs.HEROKU_APP_NAME }}
5+
HEROKU_RELEASE_STORYBOOK_APP_NAME:
6+
value: ${{ steps.which-app.outputs.HEROKU_RELEASE_STORYBOOK_APP_NAME }}
7+
runs:
8+
using: composite
9+
steps:
10+
- name: Set which app to deploy to on Heroku
11+
id: which-app
12+
# if on default branch without a tag
13+
# then publish to UPCOMING
14+
#
15+
# if on default branch and tag of X.X.X-*
16+
# then publish to CORE-MAIN
17+
#
18+
# if on any branch and tag of X.X.X
19+
# then publish to CORE-PATCH
20+
#
21+
# All other cases publish to the review app
22+
run: |-
23+
export CURRENT_DEFAULT_BRANCH=`git remote show origin | grep "HEAD branch" | cut -d ":" -f 2 | xargs`
24+
echo 'HEROKU_RELEASE_STORYBOOK_APP_NAME=false' >> $GITHUB_OUTPUT
25+
if [[ "${{ github.ref }}" = "${CURRENT_DEFAULT_BRANCH}" ]] ; then
26+
echo "Publishing to UPCOMING..."
27+
echo 'HEROKU_APP_NAME=${HEROKU_APP_UPCOMING}' >> $GITHUB_OUTPUT
28+
echo 'HEROKU_RELEASE_STORYBOOK_APP_NAME=storybook-upcoming' >> $GITHUB_OUTPUT
29+
elif [[ ${{ github.ref }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+-.+$ ]] ; then
30+
echo "Publishing to CORE-MAIN..."
31+
echo 'HEROKU_APP_NAME=${HEROKU_APP_CORE_MAIN}' >> $GITHUB_OUTPUT
32+
echo 'HEROKU_RELEASE_STORYBOOK_APP_NAME=storybook-core-main' >> $GITHUB_OUTPUT
33+
elif [[ ${{ github.ref }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then
34+
echo "Publishing to CORE-PATCH..."
35+
echo 'HEROKU_APP_NAME=${HEROKU_APP_CORE_PATCH}' >> $GITHUB_OUTPUT
36+
echo 'HEROKU_RELEASE_STORYBOOK_APP_NAME=storybook-core-patch' >> $GITHUB_OUTPUT
37+
else
38+
echo "Publishing to pull-request review app..."
39+
echo 'HEROKU_APP_NAME=slds-review-site-pr-${{ github.event.pull_request.number }}' >> $GITHUB_OUTPUT
40+
echo 'HEROKU_RELEASE_STORYBOOK_APP_NAME=true' >> $GITHUB_OUTPUT
41+
fi
42+
shell: bash
43+
- run: printenv | sort
44+
shell: bash
45+
- run: |-
46+
HEROKU_APP_NAME=${{ steps.which-app.outputs.HEROKU_APP_NAME }}
47+
HEROKU_RELEASE_STORYBOOK_APP_NAME=${{ steps.which-app.outputs.HEROKU_RELEASE_STORYBOOK_APP_NAME }}
48+
echo $HEROKU_APP_NAME > workspace/heroku-app-name.txt
49+
echo $HEROKU_RELEASE_STORYBOOK_APP_NAME > workspace/heroku-release-storybook-app-name.txt
50+
shell: bash
51+
- name: Show HEROKU_APP_NAME value
52+
run: |-
53+
echo
54+
echo "PR_NUMBER = ${{ github.event.pull_request.number }}"
55+
echo
56+
echo "HEROKU_APP_NAME=============================="
57+
cat workspace/heroku-app-name.txt
58+
echo "============================================="
59+
echo
60+
echo
61+
echo "HEROKU_RELEASE_STORYBOOK_APP_NAME============"
62+
cat workspace/heroku-release-storybook-app-name.txt
63+
echo "============================================="
64+
echo
65+
shell: bash

.github/workflows/a11y.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: A11y Testing
2+
3+
on: pull_request
4+
5+
jobs:
6+
prepare-a11y-testing:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- uses: actions/setup-node@v3
13+
# I wanted to use an action, but the action recommends not using itself because
14+
# Since v1.8.0 Playwright includes CLI that installs all required browser dependencies.
15+
- name: Install Playwright dependencies
16+
run: npx playwright install-deps
17+
18+
- name: Show GitHub context
19+
env:
20+
GITHUB_CONTEXT: ${{ toJson(github) }}
21+
run: echo "$GITHUB_CONTEXT"
22+
23+
- name: Install and Build task
24+
run: |
25+
npm ci
26+
npm run build
27+
28+
- name: Build Storybook
29+
run: npm run storybook:build
30+
31+
- name: Cache establish
32+
uses: actions/cache@v2
33+
id: cache
34+
with:
35+
path: ./.www
36+
key: www-cache-${{ github.event.pull_request.head.sha }}
37+
38+
- name: List .www folder
39+
run: ls -la .www
40+
41+
a11y-testing:
42+
needs: prepare-a11y-testing
43+
continue-on-error: ${{ matrix.ignore-error }}
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
test-file-bunch: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
48+
ignore-error: [true]
49+
runs-on: ubuntu-latest
50+
env:
51+
NODE_ENV: development
52+
A11Y_SERVER: http://localhost:9002
53+
54+
steps:
55+
- uses: actions/checkout@v2
56+
57+
- uses: actions/setup-node@v3
58+
59+
- name: Install deps
60+
run: npm ci
61+
62+
- name: Restore cache
63+
uses: actions/cache@v2
64+
id: cache
65+
with:
66+
path: ./.www
67+
key: www-cache-${{ github.event.pull_request.head.sha }}
68+
69+
- name: List the workspace
70+
run: echo "Workspace:" && ls -la .
71+
72+
- name: List the state of cache
73+
run: echo "Cache:" && ls -la .www
74+
75+
- name: Start web server
76+
run: npm run server:bg:start
77+
78+
- name: Generate test files
79+
run: |
80+
npx wait-on --verbose --timeout 10000 ${{ env.A11Y_SERVER }}
81+
npm run test:a11y:generate-tests
82+
83+
- name: Run a11y tests
84+
run: |
85+
npx wait-on --verbose --timeout 10000 ${{ env.A11Y_SERVER }} && curl -sL -w "======================\\nWait-on return code: %{http_code}\\n======================\\n\\n" "${{ env.A11Y_SERVER }}" -o /dev/null
86+
mkdir -p ./__tests__/a11y/xml/
87+
npx ava --tap ./__tests__/a11y/__testfiles__/ava.a11y.${{ matrix.test-file-bunch }}*.spec.js | npx tap-xunit --package="SLDS.a11y" > ./__tests__/a11y/xml/axe-results-${{ matrix.test-file-bunch }}.xml
88+
timeout-minutes: 20
89+
90+
- name: List the test files
91+
if: success() || failure()
92+
run: if test -d __tests__/a11y/results; then echo 'Test Results files:' && ls -la ./__tests__/a11y/results; else echo 'No Test Results'; fi
93+
94+
- name: Stop server
95+
if: always()
96+
run: npm run server:bg:delete
97+
98+
- name: Archive test results
99+
if: success() || failure()
100+
uses: actions/upload-artifact@v3
101+
with:
102+
name: a11y
103+
path: __tests__/a11y/results/
104+
105+
- name: Archive test xml
106+
if: success() || failure()
107+
uses: actions/upload-artifact@v3
108+
with:
109+
name: a11y-xml
110+
path: __tests__/a11y/xml/
111+
112+
# TODO: get it to work from artifacts
113+
- name: Publish Test Results (publish-unit-test-result-action)
114+
uses: EnricoMi/publish-unit-test-result-action@v2
115+
if: success() || failure()
116+
with:
117+
check_name: publish-unit-test-result-action Results
118+
junit_files: "__tests__/a11y/xml/**/*.xml"

.github/workflows/on-pr-labeled.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)