diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 810388aca8..87c4f2c6ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,12 +17,23 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 + - name: Install Corepack if needed + run: corepack -v || npm install -g corepack + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v2 with: node-version: ${{matrix.node-version}} - - name: Install Corepack if needed - run: corepack -v || npm install -g corepack - name: Install dependencies run: corepack yarn install --immutable - name: Run tests @@ -34,12 +45,17 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - - name: Cache npm dependencies - id: cache-npm-libraries - uses: actions/cache@v2 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: .yarn/cache/* - key: ${{ runner.os }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v2 with: @@ -55,12 +71,17 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - - name: Cache npm dependencies - id: cache-npm-libraries - uses: actions/cache@v2 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: .yarn/cache/* - key: ${{ runner.os }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v2 with: @@ -76,6 +97,17 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v2 with: diff --git a/.github/workflows/companion.yml b/.github/workflows/companion.yml index 1472d57ce6..489da687f2 100644 --- a/.github/workflows/companion.yml +++ b/.github/workflows/companion.yml @@ -16,18 +16,23 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - - name: Cache npm dependencies - id: cache-npm-libraries - uses: actions/cache@v2 + - name: Install Corepack if needed + run: corepack -v || npm install -g corepack + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: .yarn/cache/* - key: ${{ runner.os }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v2 with: node-version: ${{matrix.node-version}} - - name: Install Corepack if needed - run: corepack -v || npm install -g corepack - name: Install dependencies run: corepack yarn install --immutable env: diff --git a/.github/workflows/end-to-end.yml b/.github/workflows/end-to-end.yml index 8259e513c6..b5710e3b9a 100644 --- a/.github/workflows/end-to-end.yml +++ b/.github/workflows/end-to-end.yml @@ -17,12 +17,17 @@ jobs: # Necessary for yarn version plugin # https://yarnpkg.com/features/release-workflow#commit-history fetch-depth: 0 - - name: Cache npm dependencies - id: cache-npm-libraries - uses: actions/cache@v2 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: .yarn/cache/* - key: ${{ runner.os }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v2 with: diff --git a/.github/workflows/manual-cdn.yml b/.github/workflows/manual-cdn.yml index eb3c03cae9..a83832cabb 100644 --- a/.github/workflows/manual-cdn.yml +++ b/.github/workflows/manual-cdn.yml @@ -13,18 +13,23 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - - name: Cache npm dependencies - id: cache-npm-libraries - uses: actions/cache@v2 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: .yarn/cache/* - key: ${{ runner.os }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v2 with: node-version: 16.x - name: Install dependencies - run: corepack yarn install + run: corepack yarn install --immutable - name: Build before publishing run: corepack yarn run build - name: Upload `${{ github.event.inputs.name }}` to CDN diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index 9eadcee0ea..d7949fc56a 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -18,18 +18,23 @@ jobs: git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" git rebase FETCH_HEAD - - name: Cache npm dependencies - id: cache-npm-libraries - uses: actions/cache@v2 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: .yarn/cache/* - key: ${{ runner.os }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v2 with: node-version: 16.x - name: Install dependencies - run: corepack yarn install + run: corepack yarn install --immutable - name: Bump candidate packages version run: corepack yarn version apply --all --json | jq -s > releases.json - name: Prepare changelog diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 82be9207ba..076dd62c9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,18 +13,23 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 2 - - name: Cache npm dependencies - id: cache-npm-libraries - uses: actions/cache@v2 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: .yarn/cache/* - key: ${{ runner.os }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v2 with: node-version: 16.x - name: Install dependencies - run: corepack yarn install + run: corepack yarn install --immutable - name: Get CHANGELOG diff run: git --no-pager diff HEAD^ -- CHANGELOG.md | awk '{ if( substr($0,0,1) == "+" && $1 != "+##" && $1 != "+Released:" && $1 != "+++" ) { print substr($0,2) } }' > CHANGELOG.diff.md - name: Copy README for `uppy` package diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index cb8c345b58..87ab4558c8 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -11,12 +11,17 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - - name: Cache npm dependencies - id: cache-npm-libraries - uses: actions/cache@v2 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: .yarn/cache/* - key: ${{ runner.os }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install Node.js uses: actions/setup-node@v2 with: