Improve caching for Yarn based on https://github.com/actions/cache/blob/main/examples.md
This commit is contained in:
		
							parent
							
								
									2d877c8557
								
							
						
					
					
						commit
						64e20a14a7
					
				
					 3 changed files with 49 additions and 26 deletions
				
			
		
							
								
								
									
										43
									
								
								.github/workflows/js.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										43
									
								
								.github/workflows/js.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -19,13 +19,17 @@ jobs: | ||||||
|       - uses: actions/setup-node@v1.4.2 |       - uses: actions/setup-node@v1.4.2 | ||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|       - uses: actions/cache@v1 |       - name: Get yarn cache directory path | ||||||
|         name: Use Node package cache |         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: |         with: | ||||||
|           path: node_modules |           path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||||||
|           key: bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock', '**/package.json') }} |           key: ${{ runner.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} | ||||||
|           restore-keys: | |           restore-keys: | | ||||||
|             bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}- |             ${{ runner.os }}-yarn-${{ matrix.node }}- | ||||||
|       - run: yarn install --frozen-lockfile |       - run: yarn install --frozen-lockfile | ||||||
|       - name: run eslint |       - name: run eslint | ||||||
|         run: yarn eslint |         run: yarn eslint | ||||||
|  | @ -40,13 +44,17 @@ jobs: | ||||||
|       - uses: actions/setup-node@v1.4.2 |       - uses: actions/setup-node@v1.4.2 | ||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|       - uses: actions/cache@v1 |       - name: Get yarn cache directory path | ||||||
|         name: Use Node package cache |         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: |         with: | ||||||
|           path: node_modules |           path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||||||
|           key: bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock', '**/package.json') }} |           key: ${{ runner.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} | ||||||
|           restore-keys: | |           restore-keys: | | ||||||
|             bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}- |             ${{ runner.os }}-yarn-${{ matrix.node }}- | ||||||
|       - run: yarn install --frozen-lockfile |       - run: yarn install --frozen-lockfile | ||||||
|       - name: run jest |       - name: run jest | ||||||
|         run: yarn jest |         run: yarn jest | ||||||
|  | @ -68,14 +76,19 @@ jobs: | ||||||
|       - uses: actions/setup-node@v1.4.2 |       - uses: actions/setup-node@v1.4.2 | ||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|       - uses: actions/cache@v1 |       - name: Get yarn cache directory path | ||||||
|         name: Use Node package cache |         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: |         with: | ||||||
|           path: node_modules |           path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||||||
|           key: bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock', '**/package.json') }} |           key: ${{ runner.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} | ||||||
|           restore-keys: | |           restore-keys: | | ||||||
|             bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}- |             ${{ runner.os }}-yarn-${{ matrix.node }}- | ||||||
|       - run: yarn install --frozen-lockfile |       - run: yarn install --frozen-lockfile | ||||||
|  | 
 | ||||||
|       - uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0 |       - uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0 | ||||||
|         with: |         with: | ||||||
|           ruby-version: ${{ matrix.ruby }} |           ruby-version: ${{ matrix.ruby }} | ||||||
|  |  | ||||||
							
								
								
									
										18
									
								
								.github/workflows/notice_js.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/notice_js.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -1,5 +1,7 @@ | ||||||
| # License: LGPL-3.0-or-later | # License: LGPL-3.0-or-later | ||||||
| name: NOTICE-js verification | name: NOTICE-js verification | ||||||
|  | env: | ||||||
|  |   node: 14.6.0 | ||||||
| on:  | on:  | ||||||
|   push: |   push: | ||||||
|     paths: |     paths: | ||||||
|  | @ -20,14 +22,18 @@ jobs: | ||||||
|       - uses: actions/checkout@v2 |       - uses: actions/checkout@v2 | ||||||
|       - uses: actions/setup-node@v1.4.2 |       - uses: actions/setup-node@v1.4.2 | ||||||
|         with: |         with: | ||||||
|           node-version: 14.6.0 |           node-version: ${{ env.node }} | ||||||
|       - uses: actions/cache@v1 |       - name: Get yarn cache directory path | ||||||
|         name: Use Node package cache |         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: |         with: | ||||||
|           path: node_modules |           path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||||||
|           key: bundle-use-node-js-ubuntu-latest-14.6.0-${{ hashFiles('**/yarn.lock', '**/package.json') }} |           key: ${{ runner.os }}-yarn-${{ env.node }}-${{ hashFiles('**/yarn.lock') }} | ||||||
|           restore-keys: | |           restore-keys: | | ||||||
|             bundle-use-node-js-ubuntu-latest-14.6.0- |             ${{ runner.os }}-yarn-${{ env.node }}- | ||||||
|       - run: yarn install --frozen-lockfile |       - run: yarn install --frozen-lockfile | ||||||
|       - name: Verify NOTICE-js |       - name: Verify NOTICE-js | ||||||
|         run: yarn notice:js |         run: yarn notice:js | ||||||
							
								
								
									
										14
									
								
								.github/workflows/ruby.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/ruby.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -39,13 +39,17 @@ jobs: | ||||||
|       - uses: actions/setup-node@v1.4.2 |       - uses: actions/setup-node@v1.4.2 | ||||||
|         with: |         with: | ||||||
|           node-version: ${{ matrix.node }} |           node-version: ${{ matrix.node }} | ||||||
|       - uses: actions/cache@v1 |       - name: Get yarn cache directory path | ||||||
|         name: Use Node package cache |         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: |         with: | ||||||
|           path: node_modules |           path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||||||
|           key: bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock', '**/package.json') }} |           key: ${{ runner.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} | ||||||
|           restore-keys: | |           restore-keys: | | ||||||
|             bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}- |             ${{ runner.os }}-yarn-${{ matrix.node }}- | ||||||
|       - run: yarn install --frozen-lockfile |       - run: yarn install --frozen-lockfile | ||||||
|       - uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0 |       - uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0 | ||||||
|         with: |         with: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Eric Schultz
						Eric Schultz