mirror of
				https://gitea.com/actions/setup-node.git
				synced 2025-10-29 15:52:42 +08:00 
			
		
		
		
	docs: enhance the readme example to include multiple os, version, and archs
This commit is contained in:
		
							
								
								
									
										30
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								README.md
									
									
									
									
									
								
							| @@ -74,24 +74,38 @@ jobs: | ||||
|       - run: npm test | ||||
| ``` | ||||
|  | ||||
| Architecture: | ||||
| The architecture can be selected using `node-arch`. Values are `x86`, `x64`, `arm64`, `armv6l`, `armv7l`, `ppc64le`, `s390x` (not all of the architectures are available on all platforms). | ||||
| Operating Systems and Architecture: | ||||
|  | ||||
| You can use any of the [supported operating systems](https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners). The architecture can be selected using `node-arch`. Values are `x86`, `x64`, `arm64`, `armv6l`, `armv7l`, `ppc64le`, `s390x` (not all of the architectures are available on all platforms). | ||||
| ```yaml | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: windows-latest | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       matrix: | ||||
|         node: [ '10', '12' ] | ||||
|         arch: ['x86', 'x64'] | ||||
|     name: Node ${{ matrix.node }} on ${{ matrix.arch }} | ||||
|         os: | ||||
|           - ubuntu-latest | ||||
|           - macos-latest | ||||
|           - windows-latest | ||||
|         node_version: | ||||
|           - 10 | ||||
|           - 12 | ||||
|           - 14 | ||||
|         node_arch: | ||||
|           - x64 | ||||
|         # an extra windows-x86 run: | ||||
|         include: | ||||
|           - os: windows-2016 | ||||
|             node_version: 12 | ||||
|             node_arch: x86 | ||||
|     name: Node ${{ matrix.node_version }} - ${{ matrix.node_arch }} on ${{ matrix.os }} | ||||
|     steps: | ||||
|       - uses: actions/checkout@v2 | ||||
|       - name: Setup node | ||||
|         uses: actions/setup-node@v1 | ||||
|         with: | ||||
|           node-version: ${{ matrix.node }} | ||||
|           node-arch: ${{ matrix.arch }} | ||||
|           node-version: ${{ matrix.node_version }} | ||||
|           node-arch: ${{ matrix.node_arch }} | ||||
|       - run: npm install | ||||
|       - run: npm test | ||||
| ``` | ||||
|   | ||||
		Reference in New Issue
	
	Block a user