From f27196bf0356c975599f457844601400a7a49617 Mon Sep 17 00:00:00 2001 From: Jesse Renee Beach Date: Fri, 28 Jan 2022 18:02:50 -0800 Subject: [PATCH] Use default NPM caching in Github Actions --- .github/workflows/test.yml | 48 +++++++------------------------------- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f39d4a..4e54f7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,30 +13,22 @@ jobs: strategy: fail-fast: false matrix: - node: [10, 12, 14, 15] + node: [12, 14, 16, 17] steps: - name: Checkout uses: actions/checkout@v2 - - name: Cache node modules - id: cache - uses: actions/cache@v2 - env: - cache-name: cache-node-modules - with: - path: node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }} - name: Load Node version ${{ matrix.node }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} + cache: npm - name: Npm Install - if: steps.cache.outputs.cache-hit != 'true' run: npm ci - name: Run Jest run: npm run test:ci - name: Run Coveralls uses: coverallsapp/github-action@1.1.3 - if: matrix.node == '12' + if: matrix.node == '16' with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./reports/lcov.info @@ -46,18 +38,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Cache node modules - id: cache - uses: actions/cache@v2 - env: - cache-name: cache-node-modules - with: - path: node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - name: Load Node uses: actions/setup-node@v2 + with: + cache: npm - name: Npm Install - if: steps.cache.outputs.cache-hit != 'true' run: npm ci - name: Flow type check run: npm run flow @@ -66,24 +51,16 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [12] + node: [16] steps: - name: Checkout uses: actions/checkout@v2 - - name: Cache node modules - id: cache - uses: actions/cache@v2 - env: - cache-name: cache-node-modules - with: - path: node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }} - name: Load Node version ${{ matrix.node }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} + cache: npm - name: Npm Install - if: steps.cache.outputs.cache-hit != 'true' run: npm ci - name: Run ESLint run: npm run lint @@ -93,18 +70,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Cache node modules - id: cache - uses: actions/cache@v2 - env: - cache-name: cache-node-modules - with: - path: node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - name: Load Node version uses: actions/setup-node@v2 + with: + cache: npm - name: Npm Install - if: steps.cache.outputs.cache-hit != 'true' run: npm ci - name: Run diff check for the breakUpAriaJSON script run: node scripts/buildModelModules.js && git diff --exit-code -- src