Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/cancel-workflow/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: 'Cancel Workflow'
description: 'Cancel this workflow on failure'
inputs:
token:
description: 'A Github PAT'
required: true
runs:
using: 'composite'
steps:
- run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/db-ui/elements/actions/runs/${{ github.run_id }}/cancel
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}
6 changes: 6 additions & 0 deletions .github/workflows/00-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ jobs:
uses: bahmutov/npm-install@v1
with:
install-command: npm ci --ignore-scripts

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/00-install-cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Install Cypress

on:
workflow_call:

jobs:
install-cypress:
name: Install Cypress
runs-on: ubuntu-latest
steps:
- name: ⬇ Checkout repo
uses: actions/checkout@v3

- name: 💻 Install dependencies
uses: cypress-io/github-action@v4
with:
working-directory: e2e
runTests: false

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .github/workflows/00-scan-secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: ↔ Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: 🐷 TruffleHog OSS
uses: trufflesecurity/trufflehog@v3.7.3
with:
path: ./
base: ${{ steps.extract_branch.outputs.branch }}
head: HEAD

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/01-build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ jobs:
with:
name: build
path: out

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/01-build-showcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,9 @@ jobs:
with:
name: showcase-${{ matrix.showcases }}
path: showcase/${{ matrix.showcases }}-showcase/dist

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/01-build-stencil-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ jobs:
with:
name: output-target-${{ matrix.themes }}-${{ steps.path.outputs.framework }}
path: packages/db-ui-elements-${{ steps.path.outputs.framework }}

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/01-build-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ jobs:
with:
name: build
path: out

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/01-get-publish-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ jobs:
env:
VALID_SEMVER_VERSION: ${{ steps.getVersion.outputs.version }}
run: echo "$VALID_SEMVER_VERSION"

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/01-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ jobs:

- name: 🔬 Run unit/snapshot tests
run: npm test

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/01-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ jobs:
npm run lint:eslint
npm run lint:stylelint
npm run lint:markdownlint

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
31 changes: 27 additions & 4 deletions .github/workflows/02-cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,47 @@ jobs:
strategy:
fail-fast: false
matrix:
containers: [areas, components, elements, showcases]
containers:
[
00-0-intro,
01-0-layout,
02-0-navigation,
02-1-navigation,
03-0-action,
04-0-data-display,
04-1-data-display,
05-0-data-input,
05-1-data-input,
06-0-feedback,
07-0-utility,
99-0-showcases,
99-1-showcases
]
steps:
- name: ⬇ Checkout repo
uses: actions/checkout@v3

- name: 🔄 Init Cache
uses: ./.github/actions/npm-cache

- name: ⬇ Download build
uses: ./.github/actions/download-tar-artifact
with:
name: build
path: out

- name: ➡ Move out in e2e
run: mv out e2e

- name: 🧪 Cypress run
# Install NPM dependencies and run all Cypress tests
uses: cypress-io/github-action@v4
with:
working-directory: e2e
start: npx http-server@14.1.1 out
wait-on: 'http://localhost:8080'
wait-on-timeout: 120
config: pageLoadTimeout=100000,baseUrl=http://localhost:8080
browser: chrome
spec: cypress/integration/${{ matrix.containers }}/*.js
ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}'

- name: 🛗 Upload Artifacts
uses: actions/upload-artifact@v2
Expand All @@ -51,3 +68,9 @@ jobs:
with:
name: cypress-videos
path: e2e/cypress/videos

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/03-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ jobs:
body: process.env.CHANGELOG_TEXT
})
console.log("CHANGELOG TEXT:", process.env.CHANGELOG_TEXT)

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/03-deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ jobs:
fi
echo "URL: $URL"
echo "### GH-Pages URL :rocket: <br> <br> $URL" >> $GITHUB_STEP_SUMMARY

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/03-publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,9 @@ jobs:
with:
name: package-${{ matrix.themes }}-v-elements
path: db-ui-v-elements${{ steps.getPkgTheme.outputs.pkgTheme }}-${{ inputs.version }}.tgz

- name: 💀 Killing me softly
uses: ./.github/actions/cancel-workflow
if: failure()
with:
token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
scan-secrets:
uses: ./.github/workflows/00-scan-secrets.yml

install-cypress:
uses: ./.github/workflows/00-install-cypress.yml

test:
uses: ./.github/workflows/01-test.yml
needs: [init]
Expand Down Expand Up @@ -42,7 +45,7 @@ jobs:

cypress:
uses: ./.github/workflows/02-cypress.yml
needs: [build-storybook]
needs: [install-cypress, build-storybook]

deploy:
uses: ./.github/workflows/03-deploy-gh-pages.yml
Expand Down
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ UserInterfaceState.xcuserstate
packages/db-ui-poc-react/.env

# Cypress
cypress/videos/*
cypress/screenshots/*
cypress/results/*
cypress/snapshots/actual
cypress/snapshots/diff
e2e/cypress/videos/*
e2e/cypress/screenshots/*
e2e/cypress/results/*
e2e/cypress/snapshots/actual
e2e/cypress/snapshots/diff


coverage/
Expand Down
9 changes: 8 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ module.exports = {
'../packages/db-ui-elements-stencil/src/**/*.stories.@(js|jsx|ts|tsx|mdx)'
],
addons: [
'@storybook/addon-essentials',
{
name: '@storybook/addon-essentials',
options: {
backgrounds: false,
measure: false,
outline: false
}
},
{
name: '@storybook/addon-docs',
options: { transcludeMarkdown: true }
Expand Down
27 changes: 15 additions & 12 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ defineCustomElements();
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
layout: 'centered',
controls: {
expanded: true,
hideNoControlsWarning: true
controls: { expanded: true, hideNoControlsWarning: true },
previewTabs: {
'storybook/docs/panel': { hidden: true },
canvas: { hidden: true }
},
viewMode: 'story',
options: {
storySort: {
method: 'alphabetical',
order: [
'Intro',
['Welcome', 'Getting Started'],
'Base',
['Colors', 'Color Preview'],
'Elements',
'Components',
'Areas',
'Development',
'Other'
'00-Intro',
['Welcome', 'Getting Started', 'Frameworks', 'Showcases'],
'01-Layout',
'02-Navigation',
'03-Action',
'04-Data-Display',
'05-Data-Input',
'06-Feedback',
'07-Utility',
'99-Development'
]
}
}
Expand Down
42 changes: 0 additions & 42 deletions cypress/integration/other/welcome-story.spec.js

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion cypress.json → e2e/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"baseUrl": "http://localhost:6006",
"reporter": "junit",
"reporterOptions": {
"mochaFile": "cypress/results/output-[hash].xml"
"mochaFile": "./cypress/results/output-[hash].xml"
},
"experimentalStudio": true,
"viewportWidth": 1920,
Expand Down
File renamed without changes.
Loading