|
| 1 | +name: Upload Example Stats |
| 2 | + |
| 3 | +# Temp only dispatch on manual dispatch |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 9 | + |
| 10 | +jobs: |
| 11 | + install: |
| 12 | + name: Install deps |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + |
| 20 | + - name: Setup node |
| 21 | + uses: actions/setup-node@v3 |
| 22 | + with: |
| 23 | + node-version: 18 |
| 24 | + |
| 25 | + - name: Install pnpm |
| 26 | + uses: pnpm/action-setup@v2 |
| 27 | + with: |
| 28 | + version: 8 |
| 29 | + run_install: false |
| 30 | + |
| 31 | + - name: Get pnpm store directory |
| 32 | + shell: bash |
| 33 | + run: | |
| 34 | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 35 | +
|
| 36 | + - name: Cache node_modules |
| 37 | + id: cache-node-modules |
| 38 | + uses: actions/cache@v3 |
| 39 | + env: |
| 40 | + cache-name: cache-codecov-js-bundle-plugin-node-modules |
| 41 | + with: |
| 42 | + path: ${{ env.STORE_PATH }} |
| 43 | + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 44 | + restore-keys: | |
| 45 | + ${{ runner.os }}-${{ env.cache-name }}- |
| 46 | +
|
| 47 | + - name: Install dependencies |
| 48 | + run: pnpm install |
| 49 | + |
| 50 | +build-and-upload-stats-data: |
| 51 | + name: Build and upload ${{ matrix.example }} stats data |
| 52 | + runs-on: ubuntu-latest |
| 53 | + needs: install |
| 54 | + strategy: |
| 55 | + fail-fast: false |
| 56 | + matrix: |
| 57 | + example: [ |
| 58 | + "next-js", |
| 59 | + "rollup", |
| 60 | + "vite", |
| 61 | + "webpack", |
| 62 | + ] |
| 63 | + steps: |
| 64 | + - name: Checkout |
| 65 | + uses: actions/checkout@v4 |
| 66 | + with: |
| 67 | + fetch-depth: 0 |
| 68 | + - name: Setup node |
| 69 | + uses: actions/setup-node@v3 |
| 70 | + with: |
| 71 | + node-version: 18 |
| 72 | + |
| 73 | + - name: Install pnpm |
| 74 | + uses: pnpm/action-setup@v2 |
| 75 | + with: |
| 76 | + version: 8 |
| 77 | + run_install: false |
| 78 | + |
| 79 | + - name: Get pnpm store directory |
| 80 | + shell: bash |
| 81 | + run: | |
| 82 | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 83 | +
|
| 84 | + - name: Cache node_modules |
| 85 | + id: cache-node-modules |
| 86 | + uses: actions/cache@v3 |
| 87 | + env: |
| 88 | + cache-name: cache-codecov-js-bundle-plugin-node-modules |
| 89 | + with: |
| 90 | + path: ${{ env.STORE_PATH }} |
| 91 | + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 92 | + restore-keys: | |
| 93 | + ${{ runner.os }}-${{ env.cache-name }}- |
| 94 | +
|
| 95 | + - name: Install dependencies |
| 96 | + run: pnpm install |
| 97 | + |
| 98 | + - name: Build plugins |
| 99 | + run: pnpm run build |
| 100 | + |
| 101 | + - name: Install built plugins |
| 102 | + run: pnpm install |
| 103 | + |
| 104 | + - name: Build ${{ matrix.example }} app |
| 105 | + working-directory: ./examples/${{ matrix.example }} |
| 106 | + env: |
| 107 | + NEXT_UPLOAD_TOKEN: ${{ env.CODECOV_ORG_TOKEN_STAGING }} |
| 108 | + NEXT_API_URL: ${{ env.CODECOV_STAGING_API_URL }} |
| 109 | + ROLLUP_UPLOAD_TOKEN: ${{ env.CODECOV_ORG_TOKEN_STAGING }} |
| 110 | + ROLLUP_API_URL: ${{ env.CODECOV_STAGING_API_URL }} |
| 111 | + VITE_UPLOAD_TOKEN: ${{ env.CODECOV_ORG_TOKEN_STAGING }} |
| 112 | + VITE_API_URL: ${{ env.CODECOV_STAGING_API_URL }} |
| 113 | + WEBPACK_UPLOAD_TOKEN: ${{ env.CODECOV_ORG_TOKEN_STAGING }} |
| 114 | + WEBPACK_API_URL: ${{ env.CODECOV_STAGING_API_URL }} |
| 115 | + run: pnpm run build |
0 commit comments