Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,6 @@ commands:
key: v2-golden-images-{{ .Branch }}-<< parameters.regression_system >>-<< parameters.regression_color >>-<< parameters.regression_scale >>-<< parameters.regression_dir >>-{{ epoch }}

jobs:
commitlint:
executor: node

steps:
- downstream
- run:
name: Define environment variable with lastest commit's message
command: |
echo 'export COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")' >> $BASH_ENV
source $BASH_ENV
- run:
name: Lint commit message
command: echo "$COMMIT_MESSAGE" | yarn commitlint --config commitlint.config.cjs

test-chromium:
executor: node

Expand Down Expand Up @@ -209,19 +195,6 @@ jobs:
- store_test_results:
path: /root/project/results/

lint:
executor: node

steps:
- downstream
- run:
name: Lint
command: yarn lint
- run: yarn analyze
- run:
name: Are there changes?
command: git diff-files --exit-code

preview-docs:
executor: node
steps:
Expand Down Expand Up @@ -374,16 +347,12 @@ jobs:

workflows:
version: 2
commitlint:
jobs:
- commitlint
build:
jobs:
- test-chromium
- test-chromium-memory
- test-firefox
- test-webkit
- lint
- hcm-visual:
filters:
branches:
Expand Down
23 changes: 20 additions & 3 deletions .github/actions/setup-job/action.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
name: Setup Job
description: Common setup for all jobs
inputs:
node-version:
description: 'The Node.js version to use'
required: false
default: '20'
runs:
using: 'composite'
steps:
- name: Enable Corepack
shell: bash
run: corepack enable

- name: Setup Node 20
- name: Setup Node LTS version
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: ${{ inputs.node-version }}
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'

## --- YARN CACHE --- ##
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would like to know more about this job and if we can leverage it for other jobs if its pulling a cache like I think it is. could improve our run time ten-fold

- name: Check for cached dependencies
continue-on-error: true
id: cache-dependencies
uses: actions/cache@v4
with:
path: |
.cache/yarn
node_modules
key: ${{ runner.os }}-node${{ inputs.node-version }}-${{ hashFiles('yarn.lock') }}

## --- INSTALL --- ##
- name: Install dependencies
shell: bash
run: yarn --immutable
run: yarn install --immutable

- name: Build the project
shell: bash
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Build
#
# This workflow validates that the commit in question can be built successfully
# in several environments:
#
# Systems: Ubuntu, MacOS, Windows
# Node: 20
#
# After the build is successful, the compiled assets are uploaded as an artifact
# to the workflow run. This allows us to download the compiled assets and use
# them in other workflows.
#
# Note: we need to skip the nx cache b/c it does not contain the compiled assets
#

on:
workflow_dispatch:
inputs:
system:
required: false
default: 'macos-latest'
node-version:
required: false
default: '20'
experimental:
required: false
default: 'false'
ref:
description: 'The branch or tag to checkout'
required: false
workflow_call:
inputs:
system:
required: false
type: string
default: 'macos-latest'
node-version:
required: false
type: string
default: '20'
experimental:
required: false
type: boolean
default: false
ref:
description: 'The branch or tag to checkout'
required: false
type: string
default: ${{ github.head_ref }}

permissions:
contents: read
pull-requests: write

defaults:
run:
shell: bash

jobs:
# ---------- Validate build for various environments ---------- #
build:
strategy:
fail-fast: false
matrix:
system:
- ${{ inputs.system }}
node-version:
- ${{ inputs.node-version }}
experimental:
- ${{ inputs.experimental }}
runs-on: ${{ matrix.system }}
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 10
name: Build ${{ matrix.system }}, node v${{ matrix.node-version }}
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.head_ref }}
fetch-depth: 0

- name: Setup Job and Install Dependencies
Copy link
Contributor Author

@caseyisonit caseyisonit Mar 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@castastrophe this job includes build do we need in the next step?

uses: ./.github/actions/setup-job
with:
node-version: ${{ matrix.node-version }}

- name: Build the project
if: always()
run: yarn build

# This step will evaluate the repo status and report the change
# If there are changes, capture the changes and upload them as an artifact
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not seeing an artifact upload and in CI I looks like this hangs after exit 1

- name: Check if there are changes
if: always()
run: |
if [[ -z $(git status --porcelain) ]]; then
echo "No changes detected"
exit 0
else
echo "Changes detected"
git status
exit 1
fi
9 changes: 5 additions & 4 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Code coverage

on:
workflow_dispatch:
workflow_call:

push:
branches:
- main
pull_request:
branches:
- main

jobs:
code-coverage-report:
Expand All @@ -15,6 +14,8 @@ jobs:
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Job and Install Dependencies
uses: ./.github/actions/setup-job
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: PR verification
# -------------------------------------------------------------
# This workflow will build and verify pull requests. It will:
# - Build the branch and fail if the build fails
# - Run code coverage tests on the PR branch
# - Lint the PR branch
# -------------------------------------------------------------

on:
merge_group:
push:
branches: [main]
pull_request:
branches: [main]
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
- auto_merge_enabled

permissions:
contents: read
pull-requests: write

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
# -------------------------------------------------------------
# Validate build for various environments
# -------------------------------------------------------------
verify_builds:
name: Verify build
# Check that the PR is not in draft mode (or if it is, that it has the run_ci label to force a build)
if: ${{ github.event.pull_request.draft != 'true' || contains(github.event.pull_request.labels.*.name, 'run_ci') }}
strategy:
fail-fast: false
matrix:
system:
- macos-latest
- ubuntu-latest
# - windows-latest
node-version:
- 20
uses: ./.github/workflows/build.yml
with:
system: ${{ matrix.system }}
node-version: ${{ matrix.node-version }}
secrets: inherit

coverage:
name: Code coverage
# Check that the PR is not in draft mode (or if it is, that it has the run_ci label to force a build)
if: ${{ github.event.pull_request.draft != 'true' || contains(github.event.pull_request.labels.*.name, 'run_ci') }}
uses: ./.github/workflows/coveralls.yml
secrets: inherit

# -------------------------------------------------------------
# Lint pre-compiled assets for consistency
# -------------------------------------------------------------
lint:
name: Lint
if: ${{ contains(github.event.pull_request.labels.*.name, 'skip_lint') == false }}
uses: ./.github/workflows/lint.yml
secrets: inherit
68 changes: 68 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Lint
#
# This workflow lints the UI library and reports back any suggested fixes
#

on:
workflow_dispatch:
workflow_call:

permissions:
contents: read
pull-requests: write

defaults:
run:
shell: bash

jobs:
# --- Lint pre-compiled assets for consistency --- #
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
eslint_diff_files: ${{ steps.changed-files.outputs.eslint_diff_files }}
stylelint_diff_files: ${{ steps.changed-files.outputs.stylelint_diff_files }}
steps:
# install but don't build - we're linting pre-compiled assets
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Job and Install Dependencies
uses: ./.github/actions/setup-job
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this includes a build step. we might consider removing it from the setup and make jobs run build explicitly


- name: Check for changed files
id: changed-files
run: |
echo "eslint=$(git diff --name-only --diff-filter=d -- "projects/documentation/**/*.ts" "packages/**/*.ts" "tools/**/*.ts" | xargs)" >> $GITHUB_OUTPUT
echo "stylelint=$(git diff --name-only --diff-filter=d -- "packages/**/*.css" "tools/**/*.css" | xargs)" >> $GITHUB_OUTPUT

- name: echo eslint changed files
run: echo ${{ steps.changed-files.outputs.eslint }}

- name: echo stylelint changed files
run: echo ${{ steps.changed-files.outputs.stylelint }}

- name: Lint component styles
uses: reviewdog/[email protected]
if: ${{ steps.changed-files.outputs.stylelint != '' }}
with:
fail_level: error
filter_mode: diff_context
level: error
reporter: github-pr-review
stylelint_input: '${{ steps.changed-files.outputs.stylelint }}'
stylelint_config: '${{ github.workspace }}/.stylelintrc.json'

- name: Run eslint on packages and stories
uses: reviewdog/[email protected]
if: ${{ steps.changed-files.outputs.eslint != '' }}
with:
fail_level: error
level: error
reporter: github-pr-review
filter_mode: diff_context
eslint_flags: '${{ steps.changed-files.outputs.eslint }}'
26 changes: 0 additions & 26 deletions .github/workflows/pr-update.yml

This file was deleted.

Loading
Loading