CLOUDP-352308 Publish both non-minified and minified bundles for dev and prod environments #7867
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: React 17 | |
| 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 in React 17 | |
| runs-on: ubuntu-latest | |
| 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: 10.18.3 | |
| cache: false | |
| - 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 }}-REACT17-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/') }} | |
| - name: Setup Node 18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install node-gyp | |
| run: pnpm add --global node-gyp | |
| - name: Init React 17 environment | |
| run: node ./scripts/react17/init.mjs | |
| - name: Install packages | |
| run: pnpm install --prefer-offline # Intentionally not using --frozen-lockfile to allow for pnpm-lock.yaml updates | |
| - name: Build packages | |
| 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 }} | |
| test: | |
| name: Test in React 17 | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.3 | |
| cache: false | |
| - uses: actions/cache/restore@v4 | |
| name: Check for build cache | |
| id: build-cache | |
| with: | |
| path: | | |
| charts/*/dist/* | |
| chat/*/dist/* | |
| packages/*/dist/* | |
| tools/*/dist/* | |
| key: ${{needs.build.outputs.cache-primary-key}} | |
| - name: Setup Node 18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install node-gyp | |
| run: pnpm add --global node-gyp | |
| - name: Init React 17 environment | |
| run: node ./scripts/react17/init.mjs | |
| - name: Install dependencies | |
| run: pnpm install --prefer-offline # Intentionally not using --frozen-lockfile to allow for pnpm-lock.yaml updates | |
| - name: Run tests in React 17 | |
| run: pnpm run test --react17 --ci |