Skip to content

Commit

Permalink
New-cli-angular (#1021)
Browse files Browse the repository at this point in the history
* 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 <hirsch88@users.noreply.github.com>
  • Loading branch information
hirsch88 and hirsch88 committed Aug 16, 2023
1 parent 8a15715 commit 01b0f88
Show file tree
Hide file tree
Showing 88 changed files with 47,637 additions and 34,201 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: 12 additions & 6 deletions .github/workflows/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ runs:
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

# - uses: ./.github/workflows/actions/upload-archive
# with:
# name: test-e2e
# output: test/TestE2eBuild.zip
# paths: test/generated
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 "incubator@baloise.dev" \
--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 }}}"
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 'Group.CH_Open-Source@baloise.ch'
git remote set-url origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$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 }}
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

2 changes: 1 addition & 1 deletion .github/workflows/actions/test-components/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ runs:
if: failure()
with:
name: cypress-snapshots-components
path: packages/components/cypress/snapshots
path: test/cypress/snapshots

27 changes: 22 additions & 5 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- uses: ./.github/workflows/actions/setup
- uses: ./.github/workflows/actions/build

build-e2e:
name: 👷 Build for E2E
docs:
name: 📝 Build Documentation
runs-on: ubuntu-latest
env:
HUSKY: 0
Expand All @@ -36,7 +36,7 @@ jobs:
with:
fetch-depth: 2
- uses: ./.github/workflows/actions/setup
- uses: ./.github/workflows/actions/build-e2e
- uses: ./.github/workflows/actions/build-docs

format:
name: 🚨 Verify Code Format
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
HUSKY: 0
needs: [build-e2e]
needs: [build]
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -109,6 +109,23 @@ jobs:
- uses: ./.github/workflows/actions/test-setup
- uses: ./.github/workflows/actions/test-components

test-angular:
name: 🧪 Angular Tests
runs-on: ubuntu-22.04
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
HUSKY: 0
needs: [build]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: ./.github/workflows/actions/setup
- uses: ./.github/workflows/actions/test-angular-setup
- uses: ./.github/workflows/actions/test-angular

test-e2e:
name: 🧪 E2E Tests
runs-on: ubuntu-22.04
Expand All @@ -117,7 +134,7 @@ jobs:
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
HUSKY: 0
needs: [build-e2e]
needs: [build]
strategy:
fail-fast: false
matrix:
Expand Down
43 changes: 2 additions & 41 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,10 @@ on:

jobs:
Publish:
name: 📝 Publish Docs
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- 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 "incubator@baloise.dev" \
--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 }}}"
- uses: ./.github/workflows/actions/docs
35 changes: 3 additions & 32 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
- cron: '00 06 * * 1-5'

jobs:
Publish:
Release:
name: 🚀 Release Nightly
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand All @@ -16,37 +17,7 @@ jobs:
with:
fetch-depth: 0

- name: Git Identity
run: |
git config --global user.name 'baopso'
git config --global user.email 'Group.CH_Open-Source@baloise.ch'
git remote set-url origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 16

- name: Update npm registry
run: npm run registry

- 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 }}
- uses: ./.github/workflows/actions/setup-release

- name: Release nightly
run: |
Expand Down
Loading

0 comments on commit 01b0f88

Please sign in to comment.