diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b92f505..8c7b431 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -9,29 +9,13 @@ jobs: prepare: name: Prepare runs-on: ubuntu-latest - outputs: - YARN_CACHE_DIR: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }} - YARN_VERSION: ${{ steps.yarn-version.outputs.YARN_VERSION }} - strategy: - matrix: - node-version: [14.x, 16.x, 18.x, 19.x] steps: - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} - - name: Get Yarn cache directory - run: echo "YARN_CACHE_DIR=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" - id: yarn-cache-dir - - name: Get Yarn version - run: echo "YARN_VERSION=$(yarn --version)" >> "$GITHUB_OUTPUT" - id: yarn-version - - name: Cache Yarn dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }} - key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }} + node-version-file: '.nvmrc' + cache: 'yarn' - name: Install Yarn dependencies run: yarn --immutable @@ -49,12 +33,8 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: Restore Yarn dependencies - uses: actions/cache@v3 - with: - path: ${{ needs.prepare.outputs.YARN_CACHE_DIR }} - key: yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }} - - run: yarn --immutable + cache: 'yarn' + - run: yarn --immutable --immutable-cache - run: yarn build - name: Require clean working directory shell: bash @@ -78,12 +58,8 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: Restore Yarn dependencies - uses: actions/cache@v3 - with: - path: ${{ needs.prepare.outputs.YARN_CACHE_DIR }} - key: yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }} - - run: yarn --immutable + cache: 'yarn' + - run: yarn --immutable --immutable-cache - run: yarn lint - name: Validate RC changelog if: ${{ startsWith(github.head_ref, 'release/') }} @@ -113,12 +89,8 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: Restore Yarn dependencies - uses: actions/cache@v3 - with: - path: ${{ needs.prepare.outputs.YARN_CACHE_DIR }} - key: yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }} - - run: yarn --immutable + cache: 'yarn' + - run: yarn --immutable --immutable-cache - run: yarn test - name: Require clean working directory shell: bash diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 5fc4c19..7818654 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -19,21 +19,11 @@ jobs: run: exit 1 - name: Checkout the repository uses: actions/checkout@v3 - - name: Setup Node.js + - name: Use Node.js uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' - - name: Get Yarn cache directory - run: echo "YARN_CACHE_DIR=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" - id: yarn-cache-dir - - name: Get Yarn version - run: echo "YARN_VERSION=$(yarn --version)" >> "$GITHUB_OUTPUT" - id: yarn-version - - name: Cache yarn dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }} - key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }} + cache: 'yarn' - name: Install npm dependencies run: yarn --immutable - name: Run build script