diff --git a/.github/workflows/components.yml b/.github/workflows/components.yml new file mode 100644 index 0000000000..6567dac0b2 --- /dev/null +++ b/.github/workflows/components.yml @@ -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 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..bf8b123eae --- /dev/null +++ b/.github/workflows/docs.yml @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..dc3563e560 --- /dev/null +++ b/.github/workflows/main.yml @@ -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 diff --git a/.github/workflows/nuxt.yml b/.github/workflows/nuxt.yml new file mode 100644 index 0000000000..d7dddb96bc --- /dev/null +++ b/.github/workflows/nuxt.yml @@ -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' diff --git a/.github/workflows/publish-canary.yml b/.github/workflows/publish-canary.yml new file mode 100644 index 0000000000..9aaef00624 --- /dev/null +++ b/.github/workflows/publish-canary.yml @@ -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}}' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000..4f8da101a9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 diff --git a/.github/workflows/vue.yml b/.github/workflows/vue.yml new file mode 100644 index 0000000000..c6a2bb5cf7 --- /dev/null +++ b/.github/workflows/vue.yml @@ -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 diff --git a/.github/workflows/webcomponents.yml b/.github/workflows/webcomponents.yml new file mode 100644 index 0000000000..8f66dc8ab5 --- /dev/null +++ b/.github/workflows/webcomponents.yml @@ -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