Skip to content

[uki/canary-*]: Canary packages added to workflow #3885

[uki/canary-*]: Canary packages added to workflow

[uki/canary-*]: Canary packages added to workflow #3885

name: Branches
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, ready_for_review, synchronize]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-updates:
name: "Check package updates"
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
core: ${{ steps.filter.outputs.core }}
canary: ${{ steps.filter.outputs.canary }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- './packages/web-components/**'
- './packages/react/**'
canary:
- './packages/canary-web-components/**'
- './packages/canary-react/**'
ic-ui-kit-static-analysis-tests:
needs: ["check-updates"]
name: "Static analysis tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install core dependencies
if: ${{ needs.check-updates.outputs.canary == 'false' }}
run: |
npm ci --legacy-peer-deps
npm run bootstrap -- -- --ci --legacy-peer-deps
npm run build
- name: Install all dependencies
if: ${{ needs.check-updates.outputs.canary == 'true' }}
run: |
npm ci --legacy-peer-deps
npm run bootstrap -- -- --ci --legacy-peer-deps
npm run build:all
- name: Lint commit messages
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")
echo "$COMMIT_MESSAGE" | npx commitlint
- name: Lint
run: npm run lint
- name: Prettier
run: npm run prettier
- name: Audit
run: npm run audit
- name: A11y tests
run: npm run test-a11y:ci
- name: Unit Component tests
run: npm run test:coverage-ci
ic-ui-kit-e2e-tests:
needs: [check-updates]
name: "E2E tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: |
npm ci --legacy-peer-deps
npm run bootstrap -- -- --ci --legacy-peer-deps
- name: E2E core tests
if: ${{ needs.check-updates.outputs.core == 'true' }}
run: npm run test-e2e
- name: E2E canary tests
if: ${{ needs.check-updates.outputs.canary == 'true' }}
run: npm run test-e2e:canary
ic-ui-kit-visual-tests:
needs: ["check-updates"]
name: "Visual regression tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: browser-actions/setup-chrome@latest
- name: Install dependencies
run: |
google-chrome --version
npm ci --legacy-peer-deps
npm run bootstrap -- -- --ci --legacy-peer-deps
- name: Core visual regression tests
if: ${{ needs.check-updates.outputs.core == 'true' }}
run: npm run test-visual:ci
- name: Canary visual regression tests
if: ${{ needs.check-updates.outputs.canary == 'true' }}
run: npm run test-visual:ci:canary
ic-ui-kit-deploy:
needs:
[
ic-ui-kit-static-analysis-tests,
ic-ui-kit-e2e-tests,
ic-ui-kit-visual-tests,
check-updates,
]
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'workflow_dispatch' }}
name: "Deploy storybook"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Extract branch name
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Install dependencies
run: |
npm ci --legacy-peer-deps
npm run bootstrap -- -- --ci --legacy-peer-deps
- name: Build core components
if: ${{ needs.check-updates.outputs.canary == 'false' }}
run: |
npm run build
- name: Build all components
if: ${{ needs.check-updates.outputs.canary == 'true' }}
run: |
npm run build:all
- name: Build web-components and react storybook
if: ${{ needs.check-updates.outputs.core == 'true' }}
run: |
npm run build-storybook:web-components
npm run build-storybook:react
- name: Build canary web-components and canary react storybook
if: ${{ needs.check-updates.outputs.canary == 'true' }}
run: |
npm run build-storybook:canary-web-components
npm run build-storybook:canary-react
- name: Deploy core web components storybook
if: ${{ needs.check-updates.outputs.core == 'true' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./packages/web-components/storybook-static
target-folder: ./branches/${{ steps.extract_branch.outputs.branch }}/web-components
- name: Deploy core react storybook
if: ${{ needs.check-updates.outputs.core == 'true' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./packages/react/storybook-static
target-folder: ./branches/${{ steps.extract_branch.outputs.branch }}/react
- name: Deploy canary web components storybook
if: ${{ needs.check-updates.outputs.canary == 'true' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./packages/canary-web-components/storybook-static
target-folder: ./branches/${{ steps.extract_branch.outputs.branch }}/canary-web-components
- name: Deploy canary react storybook
if: ${{ needs.check-updates.outputs.canary == 'true' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./packages/canary-react/storybook-static
target-folder: ./branches/${{ steps.extract_branch.outputs.branch }}/canary-react