Skip to content

Commit

Permalink
ci: 💚 switch to GitHub actions for tests
Browse files Browse the repository at this point in the history
ci: prevent storybook test running if no change

ci: fix syntax

ci: fix indent in storybook workflow

ci: fix syntax

ci: split workflows based on path

ci: fix syntax

ci: test component tests run

ci: fix nuxt-app syntax

ci: test nuxt app run

ci: add publish and canary steps

Revert "ci: test nuxt app run"

This reverts commit 2842f7c.

Revert "ci: test component tests run"

This reverts commit 127c761.
  • Loading branch information
dylankelly committed Jul 31, 2023
1 parent ec4d1a2 commit 9acd307
Show file tree
Hide file tree
Showing 8 changed files with 352 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: UI Libraries
on:
push:
paths:
- 'packages/ripple-storybook/**'
- 'packages/ripple-ui-core/**'
- 'packages/ripple-ui-forms/**'
- 'pnpm-lock.yaml'
jobs:
Storybook:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.2
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build Storybook
run: pnpm build:storybook
- name: Run Storybook tests
run: pnpm test:storybook-ci
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
workingDir: packages/ripple-storybook
storybookBuildDir: 'storybook-static'
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
skip: 'gh-readonly-queue/**'
exitOnceUploaded: true
Component-Core:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
with:
version: 8.6.2
run_install: true
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Cypress component tests
uses: cypress-io/github-action@v5
with:
working-directory: packages/ripple-ui-core
install: false
component: true
Component-Forms:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
with:
version: 8.6.2
run_install: true
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Cypress component tests
uses: cypress-io/github-action@v5
with:
working-directory: packages/ripple-ui-forms
install: false
component: true
29 changes: 29 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Docs
on:
push:
paths:
- 'docs'
- 'packages/ripple-ui-core/**'
- 'packages/ripple-ui-forms/**'
- 'pnpm-lock.yaml'
jobs:
Docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.2
run_install: false
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install Dependencies
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile
- name: Build docs
run: pnpm run build:docs
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unit & Lint
on: [push]
jobs:
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.2
run_install: false
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install Dependencies
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: pnpm run test:unit
76 changes: 76 additions & 0 deletions .github/workflows/nuxt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Nuxt
on:
push:
paths:
- 'examples/nuxt-app/**'
- 'packages/**'
- 'pnpm-lock.yaml'
- '!packages/ripple-storybook/**'
jobs:
TestNuxt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.2
run_install: false
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install Dependencies
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile

- name: Build Example Nuxt app
run: pnpm -F nuxt-app build

# CLI tool is needed for mocks in perf test
- name: Build CLI tool
run: pnpm -F nuxt-ripple-cli build

- run: npm install ./packages/nuxt-ripple-cli --global
# Run lighthouse test against nuxt-app example
- name: Run lighthouse baseline test on nuxt-app
run: pnpm -F nuxt-app lighthouse:ci

# run Cypress tests in example nuxt-app, record to Cypress cloud
Integration:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.2

- name: Install Dependencies
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile

- name: Cypress Integration (e2e) tests
uses: cypress-io/github-action@v5
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
TZ: 'Australia/Melbourne'
NUXT_PUBLIC_TIDE_BASE_URL: 'https://develop.content.reference.sdp.vic.gov.au/'
NUXT_PUBLIC_TIDE_SITE: '8888'
NUXT_PUBLIC_API_URL: 'http://localhost:3001'
NUXT_PUBLIC_TIDE_APP_SEARCH_ENGINE_NAME: a83890f7a31dea14e1ae83c6f0afacca-appsearch-index-default-node
API_PORT: '3001'
LOG_LEVEL: 'debug'
# DEBUG: '@cypress/github-action'
with:
record: true
working-directory: examples/nuxt-app
install: false
build: pnpm build
start: pnpm start
wait-on: 'http://localhost:3000/api/tide/site?id=8888'
44 changes: 44 additions & 0 deletions .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Canary
on:
push:
branches:
- develop
- release/alpha-**
jobs:
Canary:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.2
run_install: false
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install Dependencies
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile
- name: Publish canary build to @next tag
run: |
npm config set access public
npm set //npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}
pnpm release:publish-next --yes
Update_Reference:
runs-on: ubuntu-latest
needs: Canary
steps:
- name: Kick off new pipeline to update reference site
run: |
curl --location --request POST 'https://circleci.com/api/v2/project/github/dpc-sdp/reference-sdp-vic-gov-au/pipeline' \
--header 'Content-Type: application/json' \
--header "Circle-Token: ${{ secrets.CIRCLECI_API_TOKEN }}" \
--data '{"branch": "v2","parameters": {"update": true}}'
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish

on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm run build
- run: npm test
publish:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Publish semantic release
run: |
npm config set access public
npm set //npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}
pnpm release:publish --yes
33 changes: 33 additions & 0 deletions .github/workflows/vue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Vue
on:
push:
paths:
- 'examples/vue-app/**'
- 'packages/ripple-ui-core/**'
- 'packages/ripple-ui-forms/**'
- 'pnpm-lock.yaml'
jobs:
Examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.2
run_install: false

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Install Dependencies
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile

- name: Build Example Vue app
run: pnpm -F vue-app build
33 changes: 33 additions & 0 deletions .github/workflows/webcomponents.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Webcomponents
on:
push:
paths:
- 'examples/webcomponents/**'
- 'packages/ripple-ui-core/**'
- 'packages/ripple-ui-forms/**'
- 'pnpm-lock.yaml'
jobs:
Examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.2
run_install: false

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Install Dependencies
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile

- name: Build Example Webcomponents app
run: pnpm -F webcomponents build

0 comments on commit 9acd307

Please sign in to comment.