diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83b6d719a..22dfc3e20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,18 @@ jobs: with: node-version: 12.x + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - 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 Dependencies run: yarn diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 042862e6a..069b5a90e 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -3,8 +3,8 @@ name: Verify changes on: pull_request jobs: - install: - name: Install dependencies + verify: + name: Verify changes runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -14,31 +14,21 @@ jobs: with: node-version: 12.x + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - 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 dependencies run: yarn --frozen-lockfile - - uses: actions/upload-artifact@v2 - with: - name: Node Modules - path: node_modules - - verify: - name: Verify changes - needs: install - runs-on: ubuntu-latest - steps: - - name: Download math result for job 1 - uses: actions/download-artifact@v2 - with: - name: Node Modules - - - uses: actions/checkout@v2 - - - name: Setup Node 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Lint run: yarn lint @@ -47,40 +37,40 @@ jobs: browser-tests: name: Browser tests - needs: install runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x, 14.x] steps: - - name: Download math result for job 1 - uses: actions/download-artifact@v2 - with: - name: Node Modules - - uses: actions/checkout@v2 - - name: Setup Node ${{ matrix.node-version }} + - name: Setup Node 12.x uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node-version }} + node-version: 12.x + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - 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 dependencies + run: yarn --frozen-lockfile - name: Test run: yarn test:browser node-tests: name: Node tests - needs: install runs-on: ubuntu-latest strategy: matrix: node-version: [12.x, 14.x] steps: - - name: Download math result for job 1 - uses: actions/download-artifact@v2 - with: - name: Node Modules - - uses: actions/checkout@v2 - name: Setup Node ${{ matrix.node-version }} @@ -88,5 +78,20 @@ jobs: with: node-version: ${{ matrix.node-version }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - 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 dependencies + run: yarn --frozen-lockfile + - name: Test run: yarn test:node