From eb809bddc18968785908cffd3138f6bf4f1b1165 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Thu, 23 Jan 2025 02:35:52 +0000 Subject: [PATCH] less caching --- .../actions/install-dependencies/action.yml | 3 + .github/workflows/ci.yml | 71 +++++++++++++++++-- 2 files changed, 68 insertions(+), 6 deletions(-) diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index b4e8d9987310..56be40828f3c 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -4,6 +4,8 @@ inputs: node-version: description: the version of Node.js to install default: 18.20.5 + install: + description: "Run pnpm install" turbo-api: description: the api URL for connecting to the turbo remote cache turbo-team: @@ -39,5 +41,6 @@ runs: echo TURBO_ENV_MODE=loose >> .env - name: Install NPM Dependencies + if: inputs.install shell: bash run: pnpm install --frozen-lockfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 712937a6c3cf..2809a9fd2457 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,7 @@ jobs: - name: Install Dependencies uses: ./.github/actions/install-dependencies with: + install: true turbo-api: ${{ secrets.TURBO_API }} turbo-team: ${{ secrets.TURBO_TEAM }} turbo-token: ${{ secrets.TURBO_TOKEN }} @@ -102,13 +103,19 @@ jobs: with: fetch-depth: 0 - - name: Cache repository - uses: actions/cache@v3 - id: cache-repo + - name: node_modules + uses: actions/download-artifact@v4 + with: + name: ${{ github.sha }}-${{ matrix.os }}-ci-cache + path: node_modules + + - name: Install Dependencies + uses: ./.github/actions/install-dependencies with: - key: ${{ github.sha }}-${{ matrix.os }}-ci-cache - path: | - node_modules + turbo-api: ${{ secrets.TURBO_API }} + turbo-team: ${{ secrets.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - name: Check for errors run: pnpm run check @@ -118,3 +125,55 @@ jobs: - name: Check the changesets run: node -r esbuild-register tools/deployments/validate-changesets.ts + + test: + timeout-minutes: 30 + needs: ["build"] + + name: "Tests" + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-13] + filter: + [ + "./packages/*", + "./fixtures/*", + "./packages/vite-plugin-cloudflare/playground", + ] + # Things in the tools folder are for running in CI, and so only need to run on linux + include: + - os: ubuntu-latest + filter: "./tools" + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Repo + if: ${{ steps.cache-repo.outputs.cache-hit != 'true' }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: node_modules + uses: actions/download-artifact@v4 + with: + name: ${{ github.sha }}-${{ matrix.os }}-ci-cache + path: node_modules + + - name: Install Dependencies + uses: ./.github/actions/install-dependencies + with: + turbo-api: ${{ secrets.TURBO_API }} + turbo-team: ${{ secrets.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + + - name: Run tests + if: steps.changes.outputs.everything_but_markdown == 'true' + run: pnpm run test:ci --concurrency 1 --filter=${{ matrix.filter }} + env: + TMP_CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + TMP_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + NODE_OPTIONS: "--max_old_space_size=8192" + WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ + TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html + CI_OS: ${{ runner.os }}