Gjør lukknapp i alert til type button #3307
Workflow file for this run
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
name: Visual Regression Tests | |
on: | |
push: | |
branches: | |
- "main" | |
paths: | |
- "@navikt/**" | |
pull_request: | |
branches: [main, next] | |
paths: | |
- "@navikt/**" | |
jobs: | |
visual_regression_test: | |
name: "visual regression test (chromatic)" | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
pull-requests: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
cache: yarn | |
- name: Restore cache | |
uses: actions/cache@v3 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-visual-regression-test-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-visual-regression-test- | |
- name: Install dependencies | |
run: yarn | |
- name: Build packages | |
run: yarn boot | |
- name: Chromatic | |
uses: chromaui/action@v1 | |
id: chromatic_tests | |
continue-on-error: true | |
with: | |
autoAcceptChanges: "main" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
projectToken: x3xqdfgkujg | |
exitZeroOnChanges: false | |
buildScriptName: "build:storybook" | |
env: | |
STORYBOOK_GITHUB_SHA: ${{ github.sha }} | |
- name: replace storybook url | |
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'" | |
uses: frabert/replace-string-action@v2 | |
id: storybook_url | |
with: | |
pattern: "(iframe.html)" | |
string: ${{ steps.chromatic_tests.outputs.storybookUrl }} | |
replace-with: "" | |
- name: Get commit sha | |
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'" | |
id: vars | |
shell: bash | |
run: | | |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | |
- name: Find Comment | |
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'" | |
uses: peter-evans/find-comment@v2 | |
id: fc | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: "github-actions[bot]" | |
body-includes: Storybook demo | |
- name: Create or update comment | |
if: steps.chromatic_tests.outcome == 'success' && !contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push' | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
## [Storybook demo](${{steps.storybook_url.outputs.replaced}}) | |
[${{ steps.vars.outputs.sha_short }}](https://github.com/navikt/aksel/commit/${{ steps.vars.outputs.sha_short }}) | ${{steps.chromatic_tests.outputs.componentCount}} komponenter | ${{steps.chromatic_tests.outputs.specCount}} stories | |
edit-mode: replace | |
- name: Create or update failed comment | |
if: steps.chromatic_tests.outcome != 'success' && !contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push' | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
## [Storybook demo](${{steps.storybook_url.outputs.replaced}}) | |
### [Endringer til review](${{steps.chromatic_tests.outputs.url}}): ${{steps.chromatic_tests.outputs.changeCount}} | |
[${{ steps.vars.outputs.sha_short }}](https://github.com/navikt/aksel/commit/${{ steps.vars.outputs.sha_short }}) | ${{steps.chromatic_tests.outputs.componentCount}} komponenter | ${{steps.chromatic_tests.outputs.specCount}} stories | |
edit-mode: replace |