generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
143 additions
and
136 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,91 +11,91 @@ on: | |
- fix/nightly | ||
|
||
jobs: | ||
assert_test_runner: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js 14.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
|
||
- name: Install dependencies | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: Get current version of Storybook | ||
run: | | ||
echo "prev_sb_version=$(yarn list @storybook/react --depth=0 2> /dev/null | grep @storybook/react | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
echo "prev_sb_csf_version=$(yarn list @storybook/csf --depth=0 2> /dev/null | grep @storybook/csf | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
- name: Upgrade to storybook@future | ||
run: | | ||
npx storybook@future upgrade --prerelease --yes | ||
# TODO: This should not be necessary once @storybook/csf is properly updated | ||
- name: Fix local @storybook/csf version | ||
run: | | ||
yarn add @storybook/[email protected] | ||
- name: Run test runner | ||
uses: mathiasvr/command-output@v1 | ||
id: tests | ||
with: | ||
run: | | ||
yarn build | ||
yarn test-storybook:ci | ||
- name: Get prerelease version of Storybook | ||
if: ${{ failure() }} | ||
run: | | ||
echo "sb_version=$(yarn list @storybook/react --depth=0 2> /dev/null | grep @storybook/react | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
echo "sb_csf_version=$(yarn list @storybook/csf --depth=0 2> /dev/null | grep @storybook/csf | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
- name: Report incoming errors | ||
if: ${{ failure() }} | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: '${{ secrets.SLACK_CHANNEL_ID }}' | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": ":storybook: :runner: [Test Runner] The Nightly check has failed :alert:", | ||
"emoji": true | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*@storybook/react version:*\n${{ env.prev_sb_version }} >> ${{ env.sb_version }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*@storybook/csf version:*\n${{ env.prev_sb_csf_version }} >> ${{ env.sb_csf_version }}" | ||
} | ||
], | ||
"accessory": { | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "View failure", | ||
"emoji": true | ||
}, | ||
"value": "view_failure", | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"action_id": "button-action" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
# assert_test_runner: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
|
||
# - name: Use Node.js 14.x | ||
# uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: 14.x | ||
|
||
# - name: Install dependencies | ||
# uses: bahmutov/npm-install@v1 | ||
|
||
# - name: Get current version of Storybook | ||
# run: | | ||
# echo "prev_sb_version=$(yarn list @storybook/react --depth=0 2> /dev/null | grep @storybook/react | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
# echo "prev_sb_csf_version=$(yarn list @storybook/csf --depth=0 2> /dev/null | grep @storybook/csf | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
|
||
# - name: Upgrade to storybook@future | ||
# run: | | ||
# npx storybook@future upgrade --prerelease --yes | ||
|
||
# # TODO: This should not be necessary once @storybook/csf is properly updated | ||
# - name: Fix local @storybook/csf version | ||
# run: | | ||
# yarn add @storybook/[email protected] | ||
# - name: Run test runner | ||
# uses: mathiasvr/command-output@v1 | ||
# id: tests | ||
# with: | ||
# run: | | ||
# yarn build | ||
# yarn test-storybook:ci | ||
|
||
# - name: Get prerelease version of Storybook | ||
# if: ${{ failure() }} | ||
# run: | | ||
# echo "sb_version=$(yarn list @storybook/react --depth=0 2> /dev/null | grep @storybook/react | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
# echo "sb_csf_version=$(yarn list @storybook/csf --depth=0 2> /dev/null | grep @storybook/csf | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
|
||
# - name: Report incoming errors | ||
# if: ${{ failure() }} | ||
# id: slack | ||
# uses: slackapi/[email protected] | ||
# with: | ||
# channel-id: '${{ secrets.SLACK_CHANNEL_ID }}' | ||
# payload: | | ||
# { | ||
# "blocks": [ | ||
# { | ||
# "type": "header", | ||
# "text": { | ||
# "type": "plain_text", | ||
# "text": ":storybook: :runner: [Test Runner] The Nightly check has failed :alert:", | ||
# "emoji": true | ||
# } | ||
# }, | ||
# { | ||
# "type": "section", | ||
# "fields": [ | ||
# { | ||
# "type": "mrkdwn", | ||
# "text": "*@storybook/react version:*\n${{ env.prev_sb_version }} >> ${{ env.sb_version }}" | ||
# }, | ||
# { | ||
# "type": "mrkdwn", | ||
# "text": "*@storybook/csf version:*\n${{ env.prev_sb_csf_version }} >> ${{ env.sb_csf_version }}" | ||
# } | ||
# ], | ||
# "accessory": { | ||
# "type": "button", | ||
# "text": { | ||
# "type": "plain_text", | ||
# "text": "View failure", | ||
# "emoji": true | ||
# }, | ||
# "value": "view_failure", | ||
# "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
# "action_id": "button-action" | ||
# } | ||
# } | ||
# ] | ||
# } | ||
# env: | ||
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
assert_test_runner_failures: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -131,55 +131,62 @@ jobs: | |
yarn test-storybook:ci-failures | ||
content=`cat ./test-results.json` | ||
echo "::set-output name=results::$content" | ||
- name: Get prerelease version of Storybook | ||
if: ${{ always() && fromJson(steps.tests.outputs.results).numPassedTests > 0 }} | ||
echo "test_results=$(cat ./test-results.json)" >> $GITHUB_ENV | ||
- name: Print results | ||
if: ${{ always() }} | ||
run: | | ||
echo "sb_version=$(yarn list @storybook/react --depth=0 2> /dev/null | grep @storybook/react | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
echo "sb_csf_version=$(yarn list @storybook/csf --depth=0 2> /dev/null | grep @storybook/csf | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
- name: Report if any test passes | ||
if: ${{ always() && fromJson(steps.tests.outputs.results).numPassedTests > 0 }} | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: '${{ secrets.SLACK_CHANNEL_ID }}' | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": ":storybook: :runner: [Test Runner] The Nightly check for **failures** has passed :thinking_face:", | ||
"emoji": true | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*@storybook/react version:*\n${{ env.prev_sb_version }} >> ${{ env.sb_version }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*@storybook/csf version:*\n${{ env.prev_sb_csf_version }} >> ${{ env.sb_csf_version }}" | ||
} | ||
], | ||
"accessory": { | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "View failure", | ||
"emoji": true | ||
}, | ||
"value": "view_failure", | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"action_id": "button-action" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
echo ${{ steps.tests.outputs }} | ||
echo ${{ env.test_results }} | ||
echo ${{ steps.tests.outputs }} >> $GITHUB_STEP_SUMMARY | ||
# - name: Get prerelease version of Storybook | ||
# if: ${{ always() && fromJson(steps.tests.outputs.results).numPassedTests > 0 }} | ||
# run: | | ||
# echo "sb_version=$(yarn list @storybook/react --depth=0 2> /dev/null | grep @storybook/react | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
# echo "sb_csf_version=$(yarn list @storybook/csf --depth=0 2> /dev/null | grep @storybook/csf | awk -F'@' '{print $3}')" >> $GITHUB_ENV | ||
|
||
# - name: Report if any test passes | ||
# if: ${{ always() && fromJson(steps.tests.outputs.results).numPassedTests > 0 }} | ||
# id: slack | ||
# uses: slackapi/[email protected] | ||
# with: | ||
# channel-id: '${{ secrets.SLACK_CHANNEL_ID }}' | ||
# payload: | | ||
# { | ||
# "blocks": [ | ||
# { | ||
# "type": "header", | ||
# "text": { | ||
# "type": "plain_text", | ||
# "text": ":storybook: :runner: [Test Runner] The Nightly check for **failures** has passed :thinking_face:", | ||
# "emoji": true | ||
# } | ||
# }, | ||
# { | ||
# "type": "section", | ||
# "fields": [ | ||
# { | ||
# "type": "mrkdwn", | ||
# "text": "*@storybook/react version:*\n${{ env.prev_sb_version }} >> ${{ env.sb_version }}" | ||
# }, | ||
# { | ||
# "type": "mrkdwn", | ||
# "text": "*@storybook/csf version:*\n${{ env.prev_sb_csf_version }} >> ${{ env.sb_csf_version }}" | ||
# } | ||
# ], | ||
# "accessory": { | ||
# "type": "button", | ||
# "text": { | ||
# "type": "plain_text", | ||
# "text": "View failure", | ||
# "emoji": true | ||
# }, | ||
# "value": "view_failure", | ||
# "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
# "action_id": "button-action" | ||
# } | ||
# } | ||
# ] | ||
# } | ||
# env: | ||
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |