From 6efb39c6eef1ec00cfee15d19826c0915c3088f5 Mon Sep 17 00:00:00 2001 From: Matthew Beale Date: Thu, 14 Dec 2023 21:56:38 -0500 Subject: [PATCH] Improve CI a bit (#1055) Don't re-install deps fresh from the cache, don't pollute the main cache with try attempts. --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0c6a2b58..6c461d6ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,20 +11,20 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Use Node 14 - uses: actions/setup-node@v3 - with: - node-version: 14.x + - name: Use Volta + uses: volta-cli/action@v4 - name: Node Modules Cache - uses: actions/cache@v2 + id: cache-npm + uses: actions/cache@v3 with: path: '**/node_modules' key: ci-yarn-${{ hashFiles('**/yarn.lock') }} - name: Install Dependencies + if: steps.cache-npm.outputs.cache-hit != 'true' run: yarn install --frozen-lockfile - name: Lint @@ -57,21 +57,29 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Use Node 14 - uses: actions/setup-node@v3 - with: - node-version: 14.x + - name: Use Volta + uses: volta-cli/action@v4 +- name: Stash yarn.lock for cache key + run: cp yarn.lock __cache-key - name: Node Modules Cache - uses: actions/cache@v2 + id: cache-npm + uses: actions/cache@v3 with: - path: '**/node_modules' - key: ci-yarn-${{ matrix.ember-version }}-${{ hashFiles('**/yarn.lock') }} + path: | + node_modules + package.json + yarn.lock + __env + key: ci-yarn-v3-${{ matrix.ember-version }}-${{ hashFiles('config/ember-try.js', '__cache-key') }} + restore-keys: | + ci-yarn-${{ hashFiles('yarn.lock') }} - - name: Install - run: yarn install --frozen-lockfile --ignore-engines + - name: Install Dependencies + if: steps.cache-npm.outputs.cache-hit != 'true' + run: yarn install --frozen-lockfile - name: Run Tests run: node_modules/.bin/ember try:one ${{ matrix.ember-version }} --skip-cleanup