diff --git a/.github/actions/setup-bun-with-cache/action.yml b/.github/actions/setup-bun-with-cache/action.yml deleted file mode 100644 index e8b53dc..0000000 --- a/.github/actions/setup-bun-with-cache/action.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: "Setup Bun with Cache" -description: "Setup Bun, restore caches, and install dependencies" - -inputs: - cache-suffix: - description: 'Suffix for the cache key (e.g., "build", "playwright")' - required: true - enable-astro-cache: - description: "Whether to enable Astro cache restoration" - required: false - default: "false" - bun-version: - description: "Bun version to install" - required: false - default: "latest" - -runs: - using: "composite" - steps: - - name: Restore Turborepo Cache - uses: actions/cache@v4 - with: - path: .turbo - key: ${{ runner.os }}-turbo-${{ inputs.cache-suffix }}-${{ hashFiles('**/bun.lock') }} - restore-keys: | - ${{ runner.os }}-turbo-${{ inputs.cache-suffix }}- - ${{ runner.os }}-turbo- - - - name: Restore Astro Cache - if: inputs.enable-astro-cache == 'true' - uses: actions/cache@v4 - with: - path: | - .astro - node_modules/.astro - key: ${{ runner.os }}-astro-${{ hashFiles('**/bun.lock') }} - restore-keys: ${{ runner.os }}-astro- - - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version: ${{ inputs.bun-version }} - - - name: Install dependencies - shell: bash - run: bun install --frozen-lockfile diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index dfca92d..e117189 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -47,10 +47,22 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Bun with Cache - uses: ./.github/actions/setup-bun-with-cache + - name: Restore Turborepo Cache + uses: actions/cache@v4 with: - cache-suffix: ${{ matrix.check }} + path: .turbo + key: ${{ runner.os }}-turbo-${{ matrix.check }}-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-turbo-${{ matrix.check }}- + ${{ runner.os }}-turbo- + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install dependencies + run: bun install --frozen-lockfile - name: Run ${{ matrix.name }} run: bunx turbo run ${{ matrix.check }} @@ -63,11 +75,31 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Bun with Cache - uses: ./.github/actions/setup-bun-with-cache + - name: Restore Turborepo Cache + uses: actions/cache@v4 with: - cache-suffix: build - enable-astro-cache: "true" + path: .turbo + key: ${{ runner.os }}-turbo-build-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-turbo-build- + ${{ runner.os }}-turbo- + + - name: Restore Astro Cache + uses: actions/cache@v4 + with: + path: | + .astro + node_modules/.astro + key: ${{ runner.os }}-astro-${{ hashFiles('**/bun.lock') }} + restore-keys: ${{ runner.os }}-astro- + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install dependencies + run: bun install --frozen-lockfile - name: Run Build run: bunx turbo run build @@ -101,10 +133,22 @@ jobs: sudo apt-get update sudo apt-get install -y unzip - - name: Setup Bun with Cache - uses: ./.github/actions/setup-bun-with-cache + - name: Restore Turborepo Cache + uses: actions/cache@v4 with: - cache-suffix: playwright + path: .turbo + key: ${{ runner.os }}-turbo-playwright-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-turbo-playwright- + ${{ runner.os }}-turbo- + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install dependencies + run: bun install --frozen-lockfile - name: Run Playwright Tests run: bunx turbo run test:playwright