[LG-3311] feat: Combox - support dropdownWidthBasis #8394
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pull Request CI | |
| on: | |
| merge_group: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build packages | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 # Should not take more than 20 minutes to build | |
| outputs: | |
| cache-primary-key: ${{ steps.build-cache.outputs.cache-primary-key }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - uses: actions/cache/restore@v4 | |
| name: Check for build cache | |
| id: build-cache | |
| with: | |
| # Note: `path` doesn't like complex glob patterns (i.e. `+(charts|chat|packages|tools)`) | |
| path: | | |
| charts/*/dist/* | |
| chat/*/dist/* | |
| packages/*/dist/* | |
| tools/*/dist/* | |
| key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/') }} | |
| # @leafygreen-ui/icon has an additional built-in cache layer | |
| - uses: actions/cache/restore@v4 | |
| name: Restore previous icon build | |
| if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} | |
| id: icon-build-cache | |
| with: | |
| path: | | |
| packages/icon/dist | |
| key: icon-dist-${{ github.ref }}-${{ github.run_id }} | |
| # using the latest build in this branch, icon build script detects changes and only rebuilds what's stale | |
| restore-keys: | | |
| icon-dist-${{ github.ref }}- | |
| # Only setup & build if there was no build cache hit | |
| - name: Use Node 18 | |
| uses: actions/setup-node@v4 | |
| if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} | |
| with: | |
| node-version: 18 | |
| cache: 'pnpm' | |
| cache-dependency-path: 'pnpm-lock.yaml' | |
| - name: Install | |
| if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: Build | |
| if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} | |
| run: pnpm build | |
| - uses: actions/cache/save@v4 | |
| name: Save build cache | |
| if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} | |
| with: | |
| path: | | |
| charts/*/dist/* | |
| chat/*/dist/* | |
| packages/*/dist/* | |
| tools/*/dist/* | |
| key: ${{ steps.build-cache.outputs.cache-primary-key }} | |
| # @leafygreen-ui/icon has an additional built-in cache layer | |
| - name: Save icon build | |
| uses: actions/cache/save@v4 | |
| if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} | |
| with: | |
| path: packages/icon/dist | |
| key: icon-dist-${{ github.ref }}-${{ github.run_id }} | |
| lint: | |
| name: Check lints | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - name: Use Node 18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| cache: 'pnpm' | |
| cache-dependency-path: 'pnpm-lock.yaml' | |
| - uses: actions/cache/restore@v4 | |
| name: Restore build cache | |
| id: build-cache | |
| with: | |
| path: | | |
| charts/*/dist/* | |
| chat/*/dist/* | |
| packages/*/dist/* | |
| tools/*/dist/* | |
| key: ${{needs.build.outputs.cache-primary-key}} | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: lint | |
| run: pnpm lint | |
| chromatic: | |
| name: Chromatic | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - name: Use Node 18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| cache: 'pnpm' | |
| cache-dependency-path: 'pnpm-lock.yaml' | |
| - uses: actions/cache/restore@v4 | |
| name: Restore build cache | |
| id: build-cache | |
| with: | |
| path: | | |
| charts/*/dist/* | |
| chat/*/dist/* | |
| packages/*/dist/* | |
| tools/*/dist/* | |
| key: ${{needs.build.outputs.cache-primary-key}} | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: Publish to Chromatic | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=16384' | |
| uses: chromaui/action@v11.29.0 | |
| with: | |
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
| buildScriptName: 'build-storybook' | |
| onlyChanged: true | |
| exitOnceUploaded: true | |
| exitZeroOnChanges: true | |
| tests: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| permissions: | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - name: Use Node 18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| cache: 'pnpm' | |
| cache-dependency-path: 'pnpm-lock.yaml' | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - uses: actions/cache/restore@v4 | |
| name: Restore build cache | |
| id: build-cache | |
| with: | |
| path: | | |
| charts/*/dist/* | |
| chat/*/dist/* | |
| packages/*/dist/* | |
| tools/*/dist/* | |
| key: ${{needs.build.outputs.cache-primary-key}} | |
| - name: tests | |
| run: pnpm run test --ci | |
| env: | |
| JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml' | |
| - name: Coverage Report Comment | |
| uses: romeovs/lcov-reporter-action@v0.3.1 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| lcov-file: coverage/lcov.info | |
| delete-old-comments: true | |
| validate-builds: | |
| name: Validate builds & dependencies | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - name: Use Node 18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| cache: 'pnpm' | |
| cache-dependency-path: 'pnpm-lock.yaml' | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - uses: actions/cache/restore@v4 | |
| name: Restore build cache | |
| id: build-cache | |
| with: | |
| path: | | |
| charts/*/dist/* | |
| chat/*/dist/* | |
| packages/*/dist/* | |
| tools/*/dist/* | |
| key: ${{needs.build.outputs.cache-primary-key}} | |
| - name: validate | |
| run: pnpm validate |