Skip to content

feat!: rebuild ui-common on Astryx (0.2.0) #104

feat!: rebuild ui-common on Astryx (0.2.0)

feat!: rebuild ui-common on Astryx (0.2.0) #104

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version: 26
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Type check
run: pnpm run typecheck
- name: Lint
run: pnpm run lint
- name: Format check
run: pnpm run format:check
- name: Public boundary
run: pnpm run check:boundary
- name: Built Lablup theme is up to date
run: pnpm run theme:check
- name: Test
run: pnpm run test
- name: Build
run: pnpm run build
- name: Packed artifact and export paths
run: pnpm run check:pack
- name: Astryx CLI integration
run: pnpm run check:integration
external-install:
# Building green is not the same as being installable. This consumes the
# real tarball from a project that shares nothing with this repository, so
# a missing dependency, a broken exports map, or a type declaration that
# only resolves against local paths fails here rather than at a consumer.
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version: 26
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build and pack
run: |
pnpm run build
pnpm pack --pack-destination "$RUNNER_TEMP"
pnpm --filter @lablup/ui-common-cli pack --pack-destination "$RUNNER_TEMP"
# pnpm, as every consumer installs: pnpm 11 fails the install with
# ERR_PNPM_IGNORED_BUILDS when a dependency's build script is neither
# allowed nor declined, which npm never reports. fixture/pnpm-workspace.yaml
# holds the allowBuilds block a consumer needs, and makes the fixture its
# own workspace, apart from this repository's.
- name: Install the tarballs into a clean React project
working-directory: fixture
run: |
LIB=$(find "$RUNNER_TEMP" -name 'lablup-ui-common-[0-9]*.tgz' | head -1)
CLI=$(find "$RUNNER_TEMP" -name 'lablup-ui-common-cli-*.tgz' | head -1)
echo "Installing $LIB and $CLI"
pnpm add "$LIB"
pnpm add --save-dev "$CLI"
- name: Type-check and build the fixture against the packed artifact
working-directory: fixture
run: |
pnpm exec tsc --noEmit
pnpm exec vite build
# The CLI resolves the project's @lablup/ui-common and the Astryx CLI it
# pins from two different packages; this runs it where a consumer would.
- name: Run the ui-common bin from the fixture
working-directory: fixture
run: |
pnpm exec ui-common --version --verbose
pnpm exec ui-common --help > /dev/null
pnpm exec ui-common agents > /dev/null
pnpm exec ui-common component Button --json > /dev/null
pnpm exec ui-common upgrade --from 0.1 --dry-run > /dev/null
# Building is not the same as being styled. 0.1.0-alpha.0 built here
# green while shipping every component's CSS as an asset nothing could
# reach, so this asserts the rules actually land in the consumer bundle.
- name: Confirm component styles reached the consumer
run: node scripts/check-fixture-styles.mjs