-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix/SLB-410' of https://github.com/AmazeeLabs/silverbac…
…k-template into dev
- Loading branch information
Showing
24 changed files
with
1,375 additions
and
1,391 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
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Estimate | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
estimate: | ||
name: Estimate | ||
if: vars.JIRA_PROJECT_ID != '' | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Start Check Run | ||
id: check | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
CHECK_ID=$(gh api -X POST -H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
-f 'name=Estimator' \ | ||
-f 'head_sha=${{ github.event.pull_request.head.sha }}' \ | ||
-f 'status=in_progress' \ | ||
-f 'output[title]=🎲 Estimation in progress' \ | ||
-f 'output[summary]=🎲 Estimation in progress' \ | ||
/repos/${{ github.repository }}/check-runs --jq '.id') | ||
echo "check_id=$CHECK_ID" >> $GITHUB_OUTPUT | ||
- name: Install estimator | ||
run: npm install -g @amazeelabs/estimator | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Find common ancestor | ||
id: ancestor | ||
env: | ||
BASE_BRANCH: ${{ github.base_ref }} | ||
run: | ||
echo "hash=$(git merge-base --fork-point origin/$BASE_BRANCH)" >> | ||
$GITHUB_OUTPUT | ||
|
||
- name: Estimate | ||
id: estimate | ||
env: | ||
JIRA_PROJECT_ID: ${{ vars.JIRA_PROJECT_ID }} | ||
PARENT_COMMIT: ${{ steps.ancestor.outputs.hash }} | ||
DASHBOARD_ACCESS_TOKEN: ${{ secrets.DASHBOARD_ACCESS_TOKEN }} | ||
run: echo "result=$(amazeelabs-estimator estimate)" >> $GITHUB_OUTPUT | ||
continue-on-error: true | ||
|
||
- name: Report success | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh api -X PATCH -H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
-f 'name=Estimator' \ | ||
-f 'head_sha=${{ github.event.pull_request.head.sha }}' \ | ||
-f 'conclusion=success' \ | ||
-f 'output[title]=🎲 ${{ steps.estimate.outputs.result }}' \ | ||
-f 'output[summary]=🎲 ${{ steps.estimate.outputs.result }}' \ | ||
/repos/${{ github.repository }}/check-runs/${{ steps.check.outputs.check_id }} | ||
if: steps.estimate.outputs.result != '' | ||
|
||
- name: Report error | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh api -X PATCH -H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
-f 'name=Estimator' \ | ||
-f 'head_sha=${{ github.event.pull_request.head.sha }}' \ | ||
-f 'conclusion=failure' \ | ||
-f 'output[title]=💥 Estimation failed' \ | ||
-f 'output[summary]=💥 Estimation failed' \ | ||
/repos/${{ github.repository }}/check-runs/${{ steps.check.outputs.check_id }} | ||
if: steps.estimate.outputs.result == '' |
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Write dashboard history | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
write_dashboard: | ||
name: Write dashboard history | ||
if: github.ref == 'refs/heads/release' && vars.JIRA_PROJECT_ID != '' | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Install estimator | ||
run: npm install -g @amazeelabs/estimator | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Update dashboard | ||
env: | ||
JIRA_PROJECT_ID: ${{ vars.JIRA_PROJECT_ID }} | ||
DASHBOARD_ACCESS_TOKEN: ${{ secrets.DASHBOARD_ACCESS_TOKEN }} | ||
run: amazeelabs-estimator write-history |
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 |
---|---|---|
|
@@ -8,8 +8,6 @@ COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules | |
COPY --from=node /usr/local/bin/node /usr/local/bin/node | ||
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm | ||
|
||
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 | ||
|
||
# Install pnpm | ||
RUN npm install -g [email protected] && pnpm config set store-dir /tmp/cache/pnpm | ||
|
||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export default { | ||
documents: [ | ||
'packages/schema/src/fragments/**/*.{gql,graphql,graphqls}', | ||
'packages/schema/src/operations/*.{gql,graphql,graphqls}', | ||
'packages/schema/src/schema.graphql', | ||
], | ||
storage: { | ||
id: process.env.JIRA_PROJECT_ID, | ||
token: process.env.DASHBOARD_ACCESS_TOKEN, | ||
api: 'https://dashboard.amazeelabs.com/api/estimator', | ||
}, | ||
}; |
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
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { TestRunnerConfig } from '@storybook/test-runner'; | ||
import { getStoryContext } from '@storybook/test-runner'; | ||
|
||
import { injectAxe, checkA11y, configureAxe } from 'axe-playwright'; | ||
|
||
/* | ||
* See https://storybook.js.org/docs/writing-tests/test-runner#test-hook-api | ||
* to learn more about the test-runner hooks API. | ||
*/ | ||
const config: TestRunnerConfig = { | ||
async preVisit(page) { | ||
await injectAxe(page); | ||
}, | ||
async postVisit(page, context) { | ||
// Get the entire context of a story, including parameters, args, argTypes, etc. | ||
const storyContext = await getStoryContext(page, context); | ||
|
||
// Apply story-level a11y rules | ||
await configureAxe(page, { | ||
rules: storyContext.parameters?.a11y?.config?.rules, | ||
}); | ||
|
||
await checkA11y(page, '#storybook-root', { | ||
detailedReport: true, | ||
detailedReportOptions: { | ||
html: true, | ||
}, | ||
}); | ||
}, | ||
}; | ||
|
||
export default config; |
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.