Skip to content

Commit

Permalink
chore: add new ci action (#1018)
Browse files Browse the repository at this point in the history
* chore: add new ci action

* chore: add new ci action

* chore: add new ci action

* chore: add new ci action

* chore: add new ci action

* chore: add new ci action

* chore: add new ci action

* chore: add new ci action

* chore: add new ci action

* chore: add new ci action

* chore: add new ci action

* chore: add new ci action

* chore: add proxy libs

* chore: add cypress job

* chore: add cypress job 2

* chore: add cypress job 2

* chore: add cypress job 4

* chore: add cypress job 5

* chore: add cypress job split

* chore: add cypress job split 2

* chore: add cypress job split 3

* chore: add cypress job split 4

* chore: add cypress job split 5

* chore: add cypress job setup

* chore: add cypress job setup 2

* add component tests

* chore: map to new cypress loc

* chore: change install setup

* chore: change install setup 2

* chore: change install setup 3

* chore: change install setup 4

* chore: change install setup 5

* chore: change install setup 6

* chore: change install setup 7

* chore: fix deps

* chore: improve install phase

* chore: format files

* chore: add base cypress tests

* chore: add unit test

* chore: add visual tests

* chore: update build

* chore: add visual reporter

* chore: add visual reporter + 2

* chore: add missing shell

* chore: build components for the tests

* chore: set missing env

* chore: update utils

* chore: add www again

* chore: adjust env var type

* chore: adjust ubuntu version

* chore: change visual report

* chore: change path

* chore: update hint and pagination

* chore: update dev scripts

* chore: update hint

* chore: only install needed deps

* chore: update install script

* chore: disable husky

* chore: disable husky 2

* chore: adjust accordrion base test

* chore: update deps

* chore: update lock file

* chore: add missing docs script

* chore: fix vercel

* chore: update visual base images

* chore: update visual base images 2

* chore(): update base images

* chore: trigger build

* chore: remove unused artifacts

* chore: create build for e2e

* chore: adjust errorThreshold

* chore: remove old cypress stuff

* chore: add missing scripts

* chore: remove dedicated e2e deps

* chore: update lock files

* chore: update e2e build

* New-cli-angular (#1021)

* chore: add angular

* chore: fix naming issue

* chore: adjust port for ng test

* chore: disable ng unit test

* chore: adjust cypress config

* chore: update components

* chore: update update screenshots

* chore: update ci

* chore(): update base images

* chore: trigger build

* chore: adjust ng test

* chore: add docs job

* chore: remove comments

* chore: remove comments

---------

Co-authored-by: hirsch88 <[email protected]>

---------

Co-authored-by: hirsch88 <[email protected]>
  • Loading branch information
hirsch88 and hirsch88 committed Aug 16, 2023
1 parent 2dbd541 commit 37e7dfc
Show file tree
Hide file tree
Showing 1,531 changed files with 62,103 additions and 35,630 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Build Docs'
description: 'Build Docs'
runs:
using: 'composite'
steps:
- name: Install Dependencies
run: npm ci
shell: bash

- name: Build
run: npm run storybook
shell: bash

- uses: ./.github/workflows/actions/upload-archive
with:
name: storybook
output: StorybookBuild.zip
paths: storybook
18 changes: 18 additions & 0 deletions .github/workflows/actions/build-e2e/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Build E2E'
description: 'Build E2E'
runs:
using: 'composite'
steps:
- name: Install Dependencies
run: npm ci
shell: bash

- name: Build
run: npm run ci:build:e2e
shell: bash

- uses: ./.github/workflows/actions/upload-archive
with:
name: test-e2e
output: test/TestE2eBuild.zip
paths: test/generated
30 changes: 30 additions & 0 deletions .github/workflows/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Build'
description: 'Build'
runs:
using: 'composite'
steps:
- name: Install Dependencies
run: npm ci
shell: bash

- name: Build
run: npm run ci:build
shell: bash

- uses: ./.github/workflows/actions/upload-archive
with:
name: test-ng-e2e
output: apps/angular/TestNgE2eBuild.zip
paths: apps/angular/dist

- uses: ./.github/workflows/actions/upload-archive
with:
name: test-e2e
output: test/TestE2eBuild.zip
paths: test/generated

# - uses: ./.github/workflows/actions/upload-archive
# with:
# name: components
# output: packages/components/ComponentsBuild.zip
# paths: packages/components/dist packages/components/loader packages/components/src/components.d.ts
46 changes: 46 additions & 0 deletions .github/workflows/actions/docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Publish Docs'
description: 'Publish Docs'
runs:
using: 'composite'
steps:
- name: Declare some variables
id: vars
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: baloise/design-system-docs:${{ steps.vars.outputs.sha_short }},baloise/design-system-docs:latest

- name: Deploy
uses: addnab/docker-run-action@v3
with:
image: baloise/gitopscli:5.4.0
run: |
gitopscli deploy \
--git-provider-url https://github.com \
--username ${{ secrets.INCUBATOR_GITHUB_USER }} \
--password ${{ secrets.INCUBATOR_GITHUB_TOKEN }} \
--git-user "Baloise Incubator" \
--git-email "[email protected]" \
--organisation "baloise-incubator" \
--repository-name "okd4-example-apps" \
--file "baloise-design-system-docs-test/values.yaml" \
--values "{designsystem.image.tag: ${{ steps.vars.outputs.sha_short }}}"
19 changes: 19 additions & 0 deletions .github/workflows/actions/download-archive/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Archive Download'
description: 'Downloads and decompresses an archive from a previous job'
inputs:
path:
description: 'Input archive name'
filename:
description: 'Input file name'
name:
description: 'Archive name'
runs:
using: 'composite'
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
- name: Exract Archive
run: unzip -q -o ${{ inputs.path }}/${{ inputs.filename }}
shell: bash
8 changes: 8 additions & 0 deletions .github/workflows/actions/format/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: 'Format'
description: 'Format'
runs:
using: 'composite'
steps:
- name: Format Check
run: npm run ci:format
shell: bash
12 changes: 12 additions & 0 deletions .github/workflows/actions/lint/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Lint'
description: 'Lint'
runs:
using: 'composite'
steps:
- name: Install Dependencies
run: npm ci
shell: bash

- name: Lint Check
run: npm run lint
shell: bash
39 changes: 39 additions & 0 deletions .github/workflows/actions/setup-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Setup Release'
description: 'Setup Release'
runs:
using: 'composite'
steps:
- name: Git Identity
run: |
git config --global user.name 'baopso'
git config --global user.email '[email protected]'
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Update NPM registry
run: npm run registry
shell: bash

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build:force
env:
BAL_DS_RELEASE: true

- name: Create .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Setup'
description: 'Setup'
runs:
using: 'composite'
steps:
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Update NPM registry
run: npm run registry
shell: bash
8 changes: 8 additions & 0 deletions .github/workflows/actions/spell/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: 'Spell'
description: 'Spell'
runs:
using: 'composite'
steps:
- name: Spell Check
run: npm run ci:spell
shell: bash
30 changes: 30 additions & 0 deletions .github/workflows/actions/test-angular-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Angular Setup'
description: 'Angular Setup'
runs:
using: 'composite'
steps:
- name: Disable Husky
run: npm pkg delete scripts.prepare
shell: bash

- name: Install Dependencies
run: npm ci
working-directory: ./apps/angular
shell: bash

- name: Install Cypress
run: npm run cy:install
working-directory: ./apps/angular
shell: bash

- uses: ./.github/workflows/actions/download-archive
with:
name: test-ng-e2e
path: ./apps/angular/dist
filename: TestNgE2eBuild.zip

# - uses: ./.github/workflows/actions/download-archive
# with:
# name: components
# path: ./packages/components
# filename: ComponentsBuild.zip
21 changes: 21 additions & 0 deletions .github/workflows/actions/test-angular/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Test Angular'
description: 'Test Angular'
runs:
using: 'composite'
steps:
- name: Run Cypress tests 🧪
uses: cypress-io/github-action@v5
with:
start: npm run cy:start
wait-on: 'http://localhost:4200'
working-directory: apps/angular
install: false
browser: chrome

- name: Upload snapshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-snapshots-angular
path: apps/angular/cypress/snapshots

20 changes: 20 additions & 0 deletions .github/workflows/actions/test-components/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Cypress Components'
description: 'Cypress Components'
runs:
using: 'composite'
steps:
- name: Run split Cypress tests 🧪
uses: cypress-io/github-action@v5
with:
working-directory: test
install: false
component: true
browser: chrome

- name: Upload snapshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-snapshots-components
path: test/cypress/snapshots

30 changes: 30 additions & 0 deletions .github/workflows/actions/test-e2e/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Cypress E2E'
description: 'Cypress E2E'
runs:
using: 'composite'
steps:
- name: Run Cypress
uses: cypress-io/github-action@v5
with:
start: npm run cy:start
wait-on: 'http://localhost:3333'
working-directory: test
install: false
browser: chrome
env: type=actual
env:
SPLIT: ${{ strategy.job-total }}
SPLIT_INDEX: ${{ strategy.job-index }}

- name: Report Visual Failures
if: failure()
working-directory: ./test
run: npm run cy:visual:report
shell: bash

- name: Upload snapshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-snapshots-components-${{ strategy.job-index }}
path: test/cypress/snapshots
24 changes: 24 additions & 0 deletions .github/workflows/actions/test-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Cypress Setup'
description: 'Cypress Setup'
runs:
using: 'composite'
steps:
- name: Disable Husky
run: npm pkg delete scripts.prepare
shell: bash

- name: Install Dependencies
run: npm ci
working-directory: ./test
shell: bash

- name: Install Cypress
run: npm run cy:install
working-directory: ./test
shell: bash

- uses: ./.github/workflows/actions/download-archive
with:
name: test-e2e
path: ./test
filename: TestE2eBuild.zip
12 changes: 12 additions & 0 deletions .github/workflows/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Test'
description: 'Test'
runs:
using: 'composite'
steps:
- name: Install Dependencies
run: npm install
shell: bash

- name: Test Check
run: npm run test
shell: bash
19 changes: 19 additions & 0 deletions .github/workflows/actions/upload-archive/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Archive Upload'
description: 'Compresses and uploads an archive to be reused across jobs'
inputs:
paths:
description: 'Paths to files or directories to archive'
output:
description: 'Output file name'
name:
description: 'Archive name'
runs:
using: 'composite'
steps:
- name: Create Archive
run: zip -q -r ${{ inputs.output }} ${{ inputs.paths }}
shell: bash
- uses: actions/upload-artifact@v3
with:
name: ${{ inputs.name }}
path: ${{ inputs.output }}
Loading

0 comments on commit 37e7dfc

Please sign in to comment.