diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ddf4ca0..b9157a2 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -34,12 +34,29 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{env.node_version }} - - uses: pnpm/action-setup@v3 + + - uses: pnpm/action-setup@v4 name: Install pnpm with: version: ${{ env.pnpm_version }} + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install - - run: pnpm install - name: Export the matrix for testing id: deploy-matrix run: pnpm exec nx run @infra/azure-functions:github-actions @@ -61,11 +78,27 @@ jobs: with: node-version: ${{ matrix.version }} - - uses: pnpm/action-setup@v3 + - uses: pnpm/action-setup@v4 name: Install pnpm with: version: ${{ env.pnpm_version }} - - run: pnpm install + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install - run: pnpm build @@ -106,11 +139,33 @@ jobs: with: node-version: ${{ matrix.version }} - - uses: pnpm/action-setup@v3 + - uses: pnpm/action-setup@v4 name: Install pnpm with: version: ${{ env.pnpm_version }} - - run: pnpm install + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - uses: actions/cache@v4 + name: Setup npm global cache + with: + path: ~/.npm + key: ${{ runner.os }}-build-azure-functions-core-tools-v4 - name: Install Azure Functions Core Tools run: npm i -g azure-functions-core-tools@4 --unsafe-perm true @@ -144,7 +199,7 @@ jobs: deploy: # Only run this job on push events - if: github.event_name == 'push' + if: github.event_name == 'push' runs-on: ubuntu-latest needs: - build @@ -173,7 +228,7 @@ jobs: e2e-azure: # Only run this job on push events - if: github.event_name == 'push' + if: github.event_name == 'push' runs-on: ubuntu-latest needs: - build @@ -194,11 +249,27 @@ jobs: with: node-version: ${{ env.node_version }} - - uses: pnpm/action-setup@v3 + - uses: pnpm/action-setup@v4 name: Install pnpm with: version: ${{ env.pnpm_version }} - - run: pnpm install + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install - name: Run E2E tests run: pnpm exec nx run @infra/azure-functions:test:e2e-remote