mirror of
				https://gitea.com/actions/setup-node.git
				synced 2025-10-29 15:52:42 +08:00 
			
		
		
		
	Add node's caching implementation (#2)
* first iteration for implementation of caching * add logs * add debug line * fix build command * fix path * add possible post-if * remove braces * test new action post-if variant * work on built-in caching * remove post-if * pass version * work on yarn support * fix return value * change names and remove logs * worked on resolving comments * check post-if for null * add success() condition * remove primary key field * work on resolving comments * remove logs * resolving comments * resolving comments * resolving comments * resolving comments * fix getpackageManagerVersion * run clean for unstaged changes * fix falling version tests * work on resolving comments * resolving comments * fix comment * resolve comments * Add tests to cover node's caching (#3) * add tests to cover node's caching * work on fixing tests * fix e2e tests * rebuild and fix test * fixing tests * change name of describes, it and fix test * add names for jobs * fix issue
This commit is contained in:
		
							
								
								
									
										101
									
								
								.github/workflows/e2e-cache.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								.github/workflows/e2e-cache.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,101 @@ | ||||
| name: e2e-cache | ||||
|  | ||||
| on: | ||||
|   pull_request: | ||||
|     paths-ignore: | ||||
|       - '**.md'     | ||||
|   push:     | ||||
|     branches: | ||||
|       - main | ||||
|       - releases/* | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|        | ||||
| jobs: | ||||
|   node-npm-depencies-caching: | ||||
|     name: Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [ubuntu-latest, windows-latest, macos-latest] | ||||
|         node-version: [10, 12, 14] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v2 | ||||
|       - name: Clean global cache | ||||
|         run: npm cache clean --force | ||||
|       - name: Setup Node | ||||
|         uses: ./ | ||||
|         with: | ||||
|           node-version: ${{ matrix.node-version }} | ||||
|           cache: 'npm' | ||||
|       - name: Install dependencies | ||||
|         run: npm install | ||||
|       - name: Verify node and npm | ||||
|         run: __tests__/verify-node.sh "${{ matrix.node-version }}" | ||||
|         shell: bash | ||||
|  | ||||
|   node-yarn1-depencies-caching: | ||||
|     name: Test yarn 1 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [ubuntu-latest, windows-latest, macos-latest] | ||||
|         node-version: [10, 12, 14] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v2 | ||||
|       - name: Yarn version | ||||
|         run: yarn --version | ||||
|       - name: Generate yarn file | ||||
|         run: yarn install | ||||
|       - name: Remove dependencies | ||||
|         shell: pwsh | ||||
|         run: Remove-Item node_modules -Force -Recurse | ||||
|       - name: Clean global cache | ||||
|         run: yarn cache clean | ||||
|       - name: Setup Node | ||||
|         uses: ./ | ||||
|         with: | ||||
|           node-version: ${{ matrix.node-version }} | ||||
|           cache: 'yarn' | ||||
|       - name: Install dependencies | ||||
|         run: yarn install | ||||
|       - name: Verify node and yarn | ||||
|         run: __tests__/verify-node.sh "${{ matrix.node-version }}" | ||||
|         shell: bash | ||||
|  | ||||
|   node-yarn2-depencies-caching: | ||||
|     name: Test yarn 2 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [ubuntu-latest, windows-latest, macos-latest] | ||||
|         node-version: [10, 12, 14] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v2 | ||||
|       - name: Update yarn | ||||
|         run: yarn set version berry | ||||
|       - name: Yarn version | ||||
|         run: yarn --version | ||||
|       - name: Generate simple .yarnrc.yml | ||||
|         run: | | ||||
|           echo "nodeLinker: node-modules" >> .yarnrc.yml | ||||
|       - name: Generate yarn file | ||||
|         run: yarn install | ||||
|       - name: Remove dependencies | ||||
|         shell: pwsh | ||||
|         run: Remove-Item node_modules -Force -Recurse | ||||
|       - name: Clean global cache | ||||
|         run: yarn cache clean --all | ||||
|       - name: Setup Node | ||||
|         uses: ./ | ||||
|         with: | ||||
|           node-version: ${{ matrix.node-version }} | ||||
|           cache: 'yarn' | ||||
|       - name: Install dependencies | ||||
|         run: yarn install | ||||
|       - name: Verify node and yarn | ||||
|         run: __tests__/verify-node.sh "${{ matrix.node-version }}" | ||||
|         shell: bash | ||||
		Reference in New Issue
	
	Block a user