diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index a4cb90a5f231e..a617ca9153b52 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -33,13 +33,9 @@ jobs: run: pnpm build - name: Cache build artifacts - uses: actions/cache@v3.3.1 + uses: actions/cache/save@v3.3.1 with: - path: | - /github/home/.cache - /github/home/.pnpm-store - ./node_modules - ./packages + path: ./packages/**/dist key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint unit-test: @@ -55,16 +51,6 @@ jobs: repository: n8n-io/n8n ref: ${{ inputs.branch }} - - name: Restore cached build artifacts - uses: actions/cache@v3.3.1 - with: - path: | - /github/home/.cache - /github/home/.pnpm-store - ./node_modules - ./packages - key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint - - uses: pnpm/action-setup@v2.4.0 - name: Use Node.js ${{ matrix.node-version }} @@ -73,6 +59,15 @@ jobs: node-version: ${{ matrix.node-version }} cache: pnpm + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Restore cached build artifacts + uses: actions/cache/restore@v3.3.1 + with: + path: ./packages/**/dist + key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint + - name: Test run: pnpm test @@ -94,16 +89,6 @@ jobs: repository: n8n-io/n8n ref: ${{ inputs.branch }} - - name: Restore cached build artifacts - uses: actions/cache@v3.3.1 - with: - path: | - /github/home/.cache - /github/home/.pnpm-store - ./node_modules - ./packages - key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint - - uses: pnpm/action-setup@v2.4.0 - name: Use Node.js ${{ matrix.node-version }} @@ -112,6 +97,15 @@ jobs: node-version: ${{ matrix.node-version }} cache: pnpm + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Restore cached build artifacts + uses: actions/cache/restore@v3.3.1 + with: + path: ./packages/**/dist + key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint + - name: Lint env: CI_LINT_MASTER: true diff --git a/.github/workflows/ci-pull-requests.yml b/.github/workflows/ci-pull-requests.yml index 1c561fd18ff16..6bc6e7f97ec32 100644 --- a/.github/workflows/ci-pull-requests.yml +++ b/.github/workflows/ci-pull-requests.yml @@ -27,13 +27,9 @@ jobs: run: pnpm build - name: Cache build artifacts - uses: actions/cache@v3.3.1 + uses: actions/cache/save@v3.3.1 with: - path: | - /github/home/.cache - /github/home/.pnpm-store - ./node_modules - ./packages + path: ./packages/**/dist key: ${{ github.sha }}-base:18-test-lint unit-test: @@ -46,16 +42,6 @@ jobs: repository: n8n-io/n8n ref: ${{ inputs.branch }} - - name: Restore cached build artifacts - uses: actions/cache@v3.3.1 - with: - path: | - /github/home/.cache - /github/home/.pnpm-store - ./node_modules - ./packages - key: ${{ github.sha }}-base:18-test-lint - - uses: pnpm/action-setup@v2.4.0 - name: Use Node.js 18 @@ -64,6 +50,15 @@ jobs: node-version: 18.x cache: pnpm + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Restore cached build artifacts + uses: actions/cache/restore@v3.3.1 + with: + path: ./packages/**/dist + key: ${{ github.sha }}-base:18-test-lint + - name: Test run: pnpm test @@ -82,16 +77,6 @@ jobs: repository: n8n-io/n8n ref: ${{ inputs.branch }} - - name: Restore cached build artifacts - uses: actions/cache@v3.3.1 - with: - path: | - /github/home/.cache - /github/home/.pnpm-store - ./node_modules - ./packages - key: ${{ github.sha }}-base:18-test-lint - - uses: pnpm/action-setup@v2.4.0 - name: Use Node.js 18 @@ -100,6 +85,15 @@ jobs: node-version: 18.x cache: pnpm + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Restore cached build artifacts + uses: actions/cache/restore@v3.3.1 + with: + path: ./packages/**/dist + key: ${{ github.sha }}-base:18-test-lint + - name: Fetch base branch for `git diff` run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} diff --git a/.github/workflows/e2e-reusable.yml b/.github/workflows/e2e-reusable.yml index 1c8c3c84b5458..c7de60e4164ba 100644 --- a/.github/workflows/e2e-reusable.yml +++ b/.github/workflows/e2e-reusable.yml @@ -87,20 +87,10 @@ jobs: git fetch origin pull/${{ inputs.pr_number }}/head git checkout FETCH_HEAD - - name: Setup pnpm - uses: pnpm/action-setup@v2.4.0 - with: - run_install: true + - uses: pnpm/action-setup@v2.4.0 - - name: Cache pnpm modules - uses: actions/cache@v3.3.1 - with: - path: | - /github/home/.cache - /github/home/.pnpm-store - ./node_modules - ./packages - key: ${{ inputs.cache-key }} + - name: Install dependencies + run: pnpm install --frozen-lockfile - name: Cypress build uses: cypress-io/github-action@v5.8.3 @@ -113,6 +103,15 @@ jobs: - name: Cypress install run: pnpm cypress:install + - name: Cache build artifacts + uses: actions/cache/save@v3.3.1 + with: + path: | + /github/home/.cache + /github/home/.pnpm-store + ./packages/**/dist + key: ${{ inputs.cache-key }} + testing: runs-on: ubuntu-latest container: @@ -137,19 +136,20 @@ jobs: git fetch origin pull/${{ inputs.pr_number }}/head git checkout FETCH_HEAD - - name: Setup pnpm - uses: pnpm/action-setup@v2.4.0 + - uses: pnpm/action-setup@v2.4.0 - name: Restore cached pnpm modules - uses: actions/cache@v3.3.1 + uses: actions/cache/restore@v3.3.1 with: path: | /github/home/.cache /github/home/.pnpm-store - ./node_modules - ./packages + ./packages/**/dist key: ${{ inputs.cache-key }} + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Cypress run uses: cypress-io/github-action@v5.8.3 with: