Compare commits
	
		
			296 Commits
		
	
	
		
			v1.0.0
			...
			kotewar/up
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 40635cc059 | |||
| 88646268d9 | |||
| 28643dda61 | |||
| 7e737fcd5c | |||
| 9645ab43e3 | |||
| 45cf7ca3f3 | |||
| 2661c0c4e3 | |||
| 31e6e0efdf | |||
| 0ed0637d81 | |||
| 3617c43588 | |||
| a82e6d0020 | |||
| fbb269240e | |||
| dfcd06a4b9 | |||
| e150063ee4 | |||
| eb1418aa81 | |||
| 499ae9c28b | |||
| a18c333f3f | |||
| 26eeac8c9e | |||
| cdc5f296eb | |||
| b80173ab1e | |||
| a96c2ca6ae | |||
| 7bbeb80d24 | |||
| d854b6da19 | |||
| 749e4491fa | |||
| aa53851224 | |||
| 5b36705a13 | |||
| 4656cbcede | |||
| ef96bec0e4 | |||
| 8e8bf44561 | |||
| 40dd195c45 | |||
| 858120d4a8 | |||
| ad9cecf99b | |||
| 8048bbee47 | |||
| 9e9f60b996 | |||
| 46f0194a3b | |||
| c69efbe773 | |||
| 3c69e15101 | |||
| bf1c35bd9d | |||
| 66a84830d9 | |||
| 8ac768a2cf | |||
| 2c7a4878f5 | |||
| e2f30c1450 | |||
| 2dfaeac2db | |||
| aa24fa78d2 | |||
| 25d94e7786 | |||
| 2fc49d780a | |||
| e6a4b93088 | |||
| 821cc3dbd1 | |||
| 4903eafcd7 | |||
| a0500669b7 | |||
| d397c16c56 | |||
| 16cca5479d | |||
| 7b469c48c4 | |||
| 2506d21b74 | |||
| 187f735c38 | |||
| 48576e577e | |||
| fa01820a3b | |||
| 62808131e1 | |||
| ddbbc2fff5 | |||
| 4fba831118 | |||
| 11556068a2 | |||
| ec303d3bdf | |||
| 1c449b9ad2 | |||
| 3e3d8c490f | |||
| 72dec17e4f | |||
| e8f1c8b5ca | |||
| 05b9e395e1 | |||
| 860f600565 | |||
| bae3140877 | |||
| fa0272551b | |||
| 30cdb8c7dd | |||
| dd80852400 | |||
| 4fe61d24fe | |||
| 45b7b136cf | |||
| f56009127d | |||
| fa513641c0 | |||
| 055250a105 | |||
| 0ed94a5678 | |||
| 83b77aa58b | |||
| 9519cf1382 | |||
| 02c73de3fe | |||
| fd3f6750a0 | |||
| 1aa8bf7608 | |||
| 9c8c90e08c | |||
| cd35109007 | |||
| d2e3f417a9 | |||
| 0aa6f2a84f | |||
| dc1a9f2791 | |||
| e886040dc2 | |||
| efbea1411b | |||
| c41070eda4 | |||
| f69f00b5e5 | |||
| 2e1dfa1fb4 | |||
| efcb607a6b | |||
| ca584e7011 | |||
| 69e93308b0 | |||
| a12e082d83 | |||
| 04d53533c2 | |||
| d8da887cad | |||
| f0bb916062 | |||
| d23aed3c80 | |||
| 8d22286106 | |||
| db2f350d2b | |||
| 5f00602cd1 | |||
| d61af71edf | |||
| ae26cabe43 | |||
| ee43590bc7 | |||
| c187df66d0 | |||
| 8db439b6b4 | |||
| e39cf0ebdc | |||
| 770ccdbc4b | |||
| 6a258a9690 | |||
| 7ac3cd263f | |||
| d34438b137 | |||
| 61c179a6ef | |||
| 68c162b39c | |||
| b02a10773f | |||
| 6df0b04fb5 | |||
| a1ad2000b3 | |||
| 3bc31aaf88 | |||
| 30cd52e29b | |||
| 2e40ee8132 | |||
| c21fb9392d | |||
| faa22ddfbc | |||
| 08e4e813b8 | |||
| 4b1b3d4a82 | |||
| a388b3faf4 | |||
| ad01d131cc | |||
| d9126d7df2 | |||
| 53ac717e09 | |||
| cbc183b1c1 | |||
| 0443912ed7 | |||
| 56b2808da7 | |||
| 00401c4488 | |||
| 1e063f2878 | |||
| 8764a52df1 | |||
| b53500dabc | |||
| ebb424f2cb | |||
| 9c7940b9c6 | |||
| fc62ccaa4f | |||
| e73e96a93b | |||
| ea31b1d738 | |||
| ff0054dfbf | |||
| 81290cdb8c | |||
| 546dae7e87 | |||
| 4d656d0138 | |||
| 719bcb4f94 | |||
| 661c4c13b4 | |||
| 2fac83dd2d | |||
| fbe6d87076 | |||
| 371353f882 | |||
| 5222f725dd | |||
| 089d28c90b | |||
| 552366fa8e | |||
| 61c9e3a719 | |||
| e3619375bd | |||
| d202f5dbf7 | |||
| 11790a2d66 | |||
| 8bb50d97d6 | |||
| fe06bcdc44 | |||
| d34a7e45c8 | |||
| 3019d15cad | |||
| 1253a7eed4 | |||
| 1277492cb9 | |||
| 38e0c8bd18 | |||
| 77d6565ede | |||
| ac9630fb91 | |||
| 36bb906fe0 | |||
| 012c21ec81 | |||
| 4d8dc69fc8 | |||
| 2d0e474aa9 | |||
| 034b7a7488 | |||
| 91d166793d | |||
| 7f2382879a | |||
| 01f44229d4 | |||
| d920b7da5f | |||
| 88965601fb | |||
| 655cb05195 | |||
| 81bfa641b0 | |||
| 6e1616c588 | |||
| 457d7a4579 | |||
| e494666ae9 | |||
| d94db22179 | |||
| 4003c04fbc | |||
| 9c7b108c73 | |||
| 505c9972aa | |||
| 5c87b70ffe | |||
| ea8ea84c9e | |||
| 6dc4d4a3ed | |||
| 5ef3a8d61b | |||
| 60cf21b5e7 | |||
| f63b906f27 | |||
| 9c4f82dc57 | |||
| 623089a937 | |||
| ec103c0d1a | |||
| 90c448a85d | |||
| 63d68602dd | |||
| 351c3fb96f | |||
| f6b96adea7 | |||
| c74a6f8415 | |||
| b52cd69bd2 | |||
| ae23cbb7c2 | |||
| 4bec33ae89 | |||
| 0e40802452 | |||
| 5c4dee6c5e | |||
| ae687a76f9 | |||
| f8061412c6 | |||
| d8ada524fc | |||
| 9b11fe4b5d | |||
| 2ccd1ad125 | |||
| c05b45bb91 | |||
| 7e36086f36 | |||
| 0e5545ead5 | |||
| 1bba665156 | |||
| 6924f73ee0 | |||
| 998be8d08f | |||
| 2e749e50a6 | |||
| ce88feea94 | |||
| ae11e1a1b6 | |||
| 4757680fc9 | |||
| 551e2a2770 | |||
| 9d56a3bd35 | |||
| 8ccac94e40 | |||
| 203550b542 | |||
| 2f85cc5281 | |||
| 70aff31eb7 | |||
| ddf78adea0 | |||
| f33acc6b4f | |||
| 6ae690c576 | |||
| b7e70417f9 | |||
| dbeab7ccf2 | |||
| 540a98ac02 | |||
| 4b6ff8caf0 | |||
| 8940139ee8 | |||
| 5e29577d7b | |||
| 1dac4fef05 | |||
| 797045350f | |||
| 948db7588e | |||
| 2b05c00514 | |||
| 96236d7072 | |||
| 12896dfb0f | |||
| bfbec53132 | |||
| c1c11bbc1b | |||
| cfdbba3eb5 | |||
| abe10fa040 | |||
| d5150a6a67 | |||
| 210fba7587 | |||
| ade090c5cf | |||
| d2eada383a | |||
| cda418e54a | |||
| d1d9006723 | |||
| 7d69f8015b | |||
| c8f8a264b4 | |||
| 1085a2b8cf | |||
| 495409509c | |||
| 18983b8d3d | |||
| 4450e92d78 | |||
| b8a0027e2c | |||
| 24327359f8 | |||
| dc5f78f54d | |||
| b0e5cf270d | |||
| 1b0417032a | |||
| 86e89385e5 | |||
| 56eacf97f5 | |||
| 56b5af70cf | |||
| a3e6ce2153 | |||
| 081536e071 | |||
| aba995482c | |||
| 73bee8ffce | |||
| e8e47f49d0 | |||
| 942699d9f7 | |||
| 980efe83e2 | |||
| 66e61f647e | |||
| 9557e68f0c | |||
| db9bf6b240 | |||
| dffd0c6733 | |||
| 5c4ee8507d | |||
| 4880cc0c18 | |||
| db3a754b1e | |||
| ef3ee0a8c4 | |||
| 53de71b0d5 | |||
| dd10aa8837 | |||
| 7c96a7c451 | |||
| b02f296bae | |||
| b7591442d5 | |||
| 7f04ebee9e | |||
| 7d219e5bd5 | |||
| 0cd7033504 | |||
| 204b974cf4 | |||
| 91b87ac691 | |||
| 40205d2e16 | |||
| a8e7064d5b | |||
| 475978becf | |||
| cbc5ae3642 | |||
| 1d41734431 | |||
| 232795a7c4 | 
							
								
								
									
										3
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| dist/index.js    -diff -merge | ||||
| dist/index.js    linguist-generated=true | ||||
| .licenses/** -diff linguist-generated=true | ||||
							
								
								
									
										2
									
								
								.github/CODEOWNERS
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.github/CODEOWNERS
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,2 @@ | ||||
| * @actions/actions-service | ||||
| * @actions/virtual-environments-owners | ||||
							
								
								
									
										32
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,32 @@ | ||||
| --- | ||||
| name: Bug report | ||||
| about: Create a bug report | ||||
| title: '' | ||||
| labels: bug, needs triage | ||||
| assignees: '' | ||||
|  | ||||
| --- | ||||
|  | ||||
| **Description:** | ||||
| A clear and concise description of what the bug is. | ||||
|  | ||||
| **Task version:** | ||||
| Specify the task version | ||||
|  | ||||
| **Platform:** | ||||
| - [ ] Ubuntu | ||||
| - [ ] macOS | ||||
| - [ ] Windows | ||||
|  | ||||
| **Runner type:** | ||||
| - [ ] Hosted | ||||
| - [ ] Self-hosted | ||||
|  | ||||
| **Repro steps:**   | ||||
| A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link. | ||||
|  | ||||
| **Expected behavior:** | ||||
| A description of what you expected to happen. | ||||
|  | ||||
| **Actual behavior:** | ||||
| A description of what is actually happening. | ||||
							
								
								
									
										1
									
								
								.github/ISSUE_TEMPLATE/config.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.github/ISSUE_TEMPLATE/config.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| blank_issues_enabled: false | ||||
							
								
								
									
										16
									
								
								.github/ISSUE_TEMPLATE/feature_request.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								.github/ISSUE_TEMPLATE/feature_request.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,16 @@ | ||||
| --- | ||||
| name: Feature request | ||||
| about: Suggest an idea for this project | ||||
| title: '' | ||||
| labels: feature request, needs triage | ||||
| assignees: '' | ||||
| --- | ||||
|  | ||||
| **Description:** | ||||
| Describe your proposal. | ||||
|  | ||||
| **Justification:** | ||||
| Justification or a use case for your proposal. | ||||
|  | ||||
| **Are you willing to submit a PR?** | ||||
| <!--- We accept contributions! --> | ||||
							
								
								
									
										9
									
								
								.github/pull_request_template.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								.github/pull_request_template.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| **Description:** | ||||
| Describe your changes. | ||||
|  | ||||
| **Related issue:** | ||||
| Add link to the related issue. | ||||
|  | ||||
| **Check list:** | ||||
| - [ ] Mark if documentation changes are required. | ||||
| - [ ] Mark if tests were added or updated to cover the changes. | ||||
							
								
								
									
										31
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,31 @@ | ||||
| name: Build Action | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - releases/* | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|  | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [ubuntu-latest, windows-latest, macos-latest] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - name: Setup Node.JS 16 | ||||
|         uses: actions/setup-node@v3 | ||||
|         with: | ||||
|           node-version: 16.x | ||||
|           cache: npm | ||||
|       - run: npm ci | ||||
|       - run: npm run build | ||||
|       - run: npm run format-check | ||||
|       - run: npm test | ||||
							
								
								
									
										52
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,52 @@ | ||||
| # `dist/index.js` is a special file in Actions. | ||||
| # When you reference an action with `uses:` in a workflow, | ||||
| # `index.js` is the code that will run. | ||||
| # For our project, we generate this file through a build process from other source files. | ||||
| # We need to make sure the checked-in `index.js` actually matches what we expect it to be. | ||||
| name: Check dist/ | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   workflow_dispatch: | ||||
|  | ||||
| jobs: | ||||
|   check-dist: | ||||
|     runs-on: ubuntu-latest | ||||
|  | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|  | ||||
|       - name: Set Node.js 16.x | ||||
|         uses: actions/setup-node@v3 | ||||
|         with: | ||||
|           node-version: 16.x | ||||
|           cache: npm | ||||
|  | ||||
|       - name: Install dependencies | ||||
|         run: npm ci | ||||
|  | ||||
|       - name: Rebuild the dist/ directory | ||||
|         run: npm run build | ||||
|  | ||||
|       - name: Compare the expected and actual dist/ directories | ||||
|         run: | | ||||
|           if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then | ||||
|             echo "Detected uncommitted changes after build.  See status below:" | ||||
|             git diff | ||||
|             exit 1 | ||||
|           fi | ||||
|         id: diff | ||||
|  | ||||
|       # If index.js was different than expected, upload the expected version as an artifact | ||||
|       - uses: actions/upload-artifact@v3 | ||||
|         if: ${{ failure() && steps.diff.conclusion == 'failure' }} | ||||
|         with: | ||||
|           name: dist | ||||
|           path: dist/ | ||||
							
								
								
									
										209
									
								
								.github/workflows/e2e-cache.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										209
									
								
								.github/workflows/e2e-cache.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,209 @@ | ||||
| name: Validate cache | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - releases/* | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|  | ||||
| defaults: | ||||
|   run: | ||||
|     shell: bash | ||||
|  | ||||
| jobs: | ||||
|   gradle-save: | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Run setup-java with the cache for gradle | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'adopt' | ||||
|           java-version: '11' | ||||
|           cache: gradle | ||||
|       - name: Create files to cache | ||||
|         # Need to avoid using Gradle daemon to stabilize the save process on Windows | ||||
|         # https://github.com/actions/cache/issues/454#issuecomment-840493935 | ||||
|         run: | | ||||
|           gradle downloadDependencies --no-daemon -p __tests__/cache/gradle | ||||
|           if [ ! -d ~/.gradle/caches ]; then | ||||
|             echo "::error::The ~/.gradle/caches directory does not exist unexpectedly" | ||||
|             exit 1 | ||||
|           fi | ||||
|   gradle-restore: | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     needs: gradle-save | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Run setup-java with the cache for gradle | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'adopt' | ||||
|           java-version: '11' | ||||
|           cache: gradle | ||||
|       - name: Confirm that ~/.gradle/caches directory has been made | ||||
|         run: | | ||||
|           if [ ! -d ~/.gradle/caches ]; then | ||||
|             echo "::error::The ~/.gradle/caches directory does not exist unexpectedly" | ||||
|             exit 1 | ||||
|           fi | ||||
|           ls ~/.gradle/caches/ | ||||
|   maven-save: | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Run setup-java with the cache for maven | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'adopt' | ||||
|           java-version: '11' | ||||
|           cache: maven | ||||
|       - name: Create files to cache | ||||
|         run: | | ||||
|           mvn verify -f __tests__/cache/maven/pom.xml | ||||
|           if [ ! -d ~/.m2/repository ]; then | ||||
|             echo "::error::The ~/.m2/repository directory does not exist unexpectedly" | ||||
|             exit 1 | ||||
|           fi | ||||
|   maven-restore: | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     needs: maven-save | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Run setup-java with the cache for maven | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'adopt' | ||||
|           java-version: '11' | ||||
|           cache: maven | ||||
|       - name: Confirm that ~/.m2/repository directory has been made | ||||
|         run: | | ||||
|           if [ ! -d ~/.m2/repository ]; then | ||||
|             echo "::error::The ~/.m2/repository directory does not exist unexpectedly" | ||||
|             exit 1 | ||||
|           fi | ||||
|           ls ~/.m2/repository | ||||
|   sbt-save: | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     defaults: | ||||
|       run: | ||||
|         shell: bash | ||||
|         working-directory: __tests__/cache/sbt | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Run setup-java with the cache for sbt | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'adopt' | ||||
|           java-version: '11' | ||||
|           cache: sbt | ||||
|       - name: Create files to cache | ||||
|         run: sbt update | ||||
|  | ||||
|       - name: Check files to cache on macos-latest | ||||
|         if: matrix.os == 'macos-latest' | ||||
|         run: | | ||||
|           if [ ! -d ~/Library/Caches/Coursier ]; then | ||||
|             echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly" | ||||
|             exit 1 | ||||
|           fi | ||||
|  | ||||
|       - name: Check files to cache on windows-latest | ||||
|         if: matrix.os == 'windows-latest' | ||||
|         run: | | ||||
|           if [ ! -d ~/AppData/Local/Coursier/Cache ]; then | ||||
|             echo "::error::The ~/AppData/Local/Coursier/Cache directory does not exist unexpectedly" | ||||
|             exit 1 | ||||
|           fi | ||||
|  | ||||
|        | ||||
|       - name: Check files to cache on ubuntu-latest | ||||
|         if: matrix.os == 'ubuntu-latest' | ||||
|         run: | | ||||
|           if [ ! -d ~/.cache/coursier ]; then | ||||
|             echo "::error::The ~/.cache/coursier directory does not exist unexpectedly" | ||||
|             exit 1 | ||||
|           fi | ||||
|  | ||||
|   sbt-restore: | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     defaults: | ||||
|       run: | ||||
|         shell: bash | ||||
|         working-directory: __tests__/cache/sbt | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     needs: sbt-save | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Run setup-java with the cache for sbt | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'adopt' | ||||
|           java-version: '11' | ||||
|           cache: sbt | ||||
|  | ||||
|       - name: Confirm that ~/Library/Caches/Coursier directory has been made | ||||
|         if: matrix.os == 'macos-latest' | ||||
|         run: | | ||||
|           if [ ! -d ~/Library/Caches/Coursier ]; then | ||||
|             echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly" | ||||
|             exit 1 | ||||
|           fi | ||||
|           ls ~/Library/Caches/Coursier | ||||
|  | ||||
|       - name: Confirm that ~/AppData/Local/Coursier/Cache directory has been made | ||||
|         if: matrix.os == 'windows-latest' | ||||
|         run: | | ||||
|           if [ ! -d ~/AppData/Local/Coursier/Cache ]; then | ||||
|             echo "::error::The ~/AppData/Local/Coursier/Cache directory does not exist unexpectedly" | ||||
|             exit 1 | ||||
|           fi | ||||
|           ls ~/AppData/Local/Coursier/Cache | ||||
|  | ||||
|       - name: Confirm that ~/.cache/coursier directory has been made | ||||
|         if: matrix.os == 'ubuntu-latest' | ||||
|         run: | | ||||
|           if [ ! -d ~/.cache/coursier ]; then | ||||
|             echo "::error::The ~/.cache/coursier directory does not exist unexpectedly" | ||||
|             exit 1 | ||||
|           fi | ||||
|           ls ~/.cache/coursier | ||||
							
								
								
									
										123
									
								
								.github/workflows/e2e-local-file.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								.github/workflows/e2e-local-file.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,123 @@ | ||||
| name: Validate local file | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - releases/* | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|  | ||||
| jobs: | ||||
|   setup-java-local-file-adopt: | ||||
|     name: Validate installation from local file Adopt | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Download Adopt OpenJDK file | ||||
|         run: | | ||||
|           if ($IsLinux) { | ||||
|             $downloadUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.10_9.tar.gz" | ||||
|             $localFilename = "java_package.tar.gz" | ||||
|           } elseif ($IsMacOS) { | ||||
|             $downloadUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_mac_hotspot_11.0.10_9.tar.gz" | ||||
|             $localFilename = "java_package.tar.gz" | ||||
|           } elseif ($IsWindows) { | ||||
|             $downloadUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_windows_hotspot_11.0.10_9.zip" | ||||
|             $localFilename = "java_package.zip" | ||||
|           } | ||||
|           echo "LocalFilename=$localFilename" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||||
|           (New-Object System.Net.WebClient).DownloadFile($downloadUrl, "$env:RUNNER_TEMP/$localFilename") | ||||
|         shell: pwsh | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'jdkfile' | ||||
|           jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }} | ||||
|           java-version: '11.0.0-ea' | ||||
|           architecture: x64 | ||||
|       - name: Verify Java version | ||||
|         run: bash __tests__/verify-java.sh "11.0.10" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
|  | ||||
|   setup-java-local-file-zulu: | ||||
|     name: Validate installation from local file Zulu | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Download Zulu OpenJDK file | ||||
|         run: | | ||||
|           if ($IsLinux) { | ||||
|             $downloadUrl = "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-linux_x64.tar.gz" | ||||
|             $localFilename = "java_package.tar.gz" | ||||
|           } elseif ($IsMacOS) { | ||||
|             $downloadUrl = "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz" | ||||
|             $localFilename = "java_package.tar.gz" | ||||
|           } elseif ($IsWindows) { | ||||
|             $downloadUrl = "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-win_x64.zip" | ||||
|             $localFilename = "java_package.zip" | ||||
|           } | ||||
|           echo "LocalFilename=$localFilename" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||||
|           (New-Object System.Net.WebClient).DownloadFile($downloadUrl, "$env:RUNNER_TEMP/$localFilename") | ||||
|         shell: pwsh | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'jdkfile' | ||||
|           jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }} | ||||
|           java-version: '11.0.0-ea' | ||||
|           architecture: x64 | ||||
|       - name: Verify Java version | ||||
|         run: bash __tests__/verify-java.sh "11.0" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
|  | ||||
|   setup-java-local-file-temurin: | ||||
|     name: Validate installation from local file Eclipse Temurin | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Download Eclipse Temurin file | ||||
|         run: | | ||||
|           if ($IsLinux) { | ||||
|             $downloadUrl = "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz" | ||||
|             $localFilename = "java_package.tar.gz" | ||||
|           } elseif ($IsMacOS) { | ||||
|             $downloadUrl = "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jdk_x64_mac_hotspot_11.0.12_7.tar.gz" | ||||
|             $localFilename = "java_package.tar.gz" | ||||
|           } elseif ($IsWindows) { | ||||
|             $downloadUrl = "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jdk_x64_windows_hotspot_11.0.12_7.zip" | ||||
|             $localFilename = "java_package.zip" | ||||
|           } | ||||
|           echo "LocalFilename=$localFilename" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||||
|           (New-Object System.Net.WebClient).DownloadFile($downloadUrl, "$env:RUNNER_TEMP/$localFilename") | ||||
|         shell: pwsh | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'jdkfile' | ||||
|           jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }} | ||||
|           java-version: '11.0.0-ea' | ||||
|           architecture: x64 | ||||
|       - name: Verify Java version | ||||
|         run: bash __tests__/verify-java.sh "11.0.12" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
							
								
								
									
										152
									
								
								.github/workflows/e2e-publishing.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										152
									
								
								.github/workflows/e2e-publishing.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,152 @@ | ||||
| name: Validate publishing functionality | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - releases/* | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|  | ||||
| defaults: | ||||
|   run: | ||||
|     shell: pwsh | ||||
|  | ||||
| jobs: | ||||
|   setup-java-publishing: | ||||
|     name: Validate settings.xml | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'adopt' | ||||
|           java-version: '11' | ||||
|           server-id: maven | ||||
|           server-username: MAVEN_USERNAME | ||||
|           server-password: MAVEN_CENTRAL_TOKEN | ||||
|           gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||||
|       - name: Validate settings.xml | ||||
|         run: | | ||||
|           $xmlPath = Join-Path $HOME ".m2" "settings.xml" | ||||
|           Get-Content $xmlPath | ForEach-Object { Write-Host $_ } | ||||
|  | ||||
|           [xml]$xml = Get-Content $xmlPath | ||||
|           $servers = $xml.settings.servers.server | ||||
|           if (($servers[0].id -ne 'maven') -or ($servers[0].username -ne '${env.MAVEN_USERNAME}') -or ($servers[0].password -ne '${env.MAVEN_CENTRAL_TOKEN}')) { | ||||
|             throw "Generated XML file is incorrect" | ||||
|           } | ||||
|  | ||||
|           if (($servers[1].id -ne 'gpg.passphrase') -or ($servers[1].passphrase -ne '${env.MAVEN_GPG_PASSPHRASE}')) { | ||||
|             throw "Generated XML file is incorrect" | ||||
|           } | ||||
|  | ||||
|   test-publishing-overwrite: | ||||
|     name: settings.xml is overwritten if flag is true | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Create fake settings.xml | ||||
|         run: | | ||||
|           $xmlDirectory = Join-Path $HOME ".m2" | ||||
|           $xmlPath = Join-Path $xmlDirectory "settings.xml" | ||||
|           New-Item -Path $xmlDirectory -ItemType Directory | ||||
|           Set-Content -Path $xmlPath -Value "Fake_XML" | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'adopt' | ||||
|           java-version: '11' | ||||
|           server-id: maven | ||||
|           server-username: MAVEN_USERNAME | ||||
|           server-password: MAVEN_CENTRAL_TOKEN | ||||
|           gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||||
|       - name: Validate settings.xml is overwritten | ||||
|         run: | | ||||
|           $xmlPath = Join-Path $HOME ".m2" "settings.xml" | ||||
|           Get-Content $xmlPath | ForEach-Object { Write-Host $_ } | ||||
|  | ||||
|           $content = Get-Content $xmlPath -Raw | ||||
|           if ($content -notlike '*maven*') { | ||||
|             throw "settings.xml file is not overwritten" | ||||
|           } | ||||
|    | ||||
|   test-publishing-skip-overwrite: | ||||
|     name: settings.xml is not overwritten if flag is false | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: Create fake settings.xml | ||||
|         run: | | ||||
|           $xmlDirectory = Join-Path $HOME ".m2" | ||||
|           $xmlPath = Join-Path $xmlDirectory "settings.xml" | ||||
|           New-Item -Path $xmlDirectory -ItemType Directory | ||||
|           Set-Content -Path $xmlPath -Value "Fake_XML" | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'adopt' | ||||
|           java-version: '11' | ||||
|           server-id: maven | ||||
|           server-username: MAVEN_USERNAME | ||||
|           server-password: MAVEN_CENTRAL_TOKEN | ||||
|           overwrite-settings: false | ||||
|           gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||||
|       - name: Validate that settings.xml is not overwritten | ||||
|         run: | | ||||
|           $xmlPath = Join-Path $HOME ".m2" "settings.xml" | ||||
|           $content = Get-Content -Path $xmlPath -Raw | ||||
|           Write-Host $content | ||||
|  | ||||
|           if ($content -notlike "*Fake_XML*") { | ||||
|             throw "settings.xml file was overwritten but it should not be" | ||||
|           } | ||||
|  | ||||
|   test-publishing-custom-location: | ||||
|     name: settings.xml in custom location | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: 'adopt' | ||||
|           java-version: '11' | ||||
|           server-id: maven | ||||
|           server-username: MAVEN_USERNAME | ||||
|           server-password: MAVEN_CENTRAL_TOKEN | ||||
|           gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||||
|           settings-path: ${{ runner.temp }} | ||||
|       - name: Validate settings.xml location | ||||
|         run: | | ||||
|           $path = Join-Path $env:RUNNER_TEMP "settings.xml" | ||||
|           if (-not (Test-Path $path)) { | ||||
|             throw "settings.xml file is not found in expected location" | ||||
|           } | ||||
							
								
								
									
										243
									
								
								.github/workflows/e2e-versions.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										243
									
								
								.github/workflows/e2e-versions.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,243 @@ | ||||
| name: Validate Java e2e | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - releases/* | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   pull_request: | ||||
|     paths-ignore: | ||||
|       - '**.md' | ||||
|   schedule: | ||||
|     - cron:  '0 */12 * * *' | ||||
|   workflow_dispatch: | ||||
| jobs: | ||||
|   setup-java-major-versions: | ||||
|     name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }} | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|         distribution: ['temurin', 'adopt', 'adopt-openj9', 'zulu', 'liberica', 'microsoft', 'corretto' ] # internally 'adopt-hotspot' is the same as 'adopt' | ||||
|         version: ['8', '11', '16'] | ||||
|         exclude: | ||||
|         - distribution: microsoft | ||||
|           version: 8 | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           java-version: ${{ matrix.version }} | ||||
|           distribution: ${{ matrix.distribution }} | ||||
|       - name: Verify Java | ||||
|         run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
|  | ||||
|   setup-java-major-minor-versions: | ||||
|     name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }} | ||||
|     needs: setup-java-major-versions | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|         distribution: ['temurin', 'zulu', 'liberica'] | ||||
|         version: | ||||
|         - '11.0' | ||||
|         - '8.0.302' | ||||
|         - '16.0.2+7' | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           java-version: ${{ matrix.version }} | ||||
|           distribution: ${{ matrix.distribution }} | ||||
|       - name: Verify Java | ||||
|         run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
|  | ||||
|   setup-java-check-latest: | ||||
|     name: ${{ matrix.distribution }} ${{ matrix.version }} - check-latest flag - ${{ matrix.os }} | ||||
|     needs: setup-java-major-versions | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|         distribution: ['temurin', 'zulu', 'liberica'] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: ${{ matrix.distribution }} | ||||
|           java-version: 11 | ||||
|           check-latest: true | ||||
|       - name: Verify Java | ||||
|         run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
|  | ||||
|   setup-java-multiple-jdks: | ||||
|     name: ${{ matrix.distribution }} ${{ matrix.version }} - multiple jdks - ${{ matrix.os }} | ||||
|     needs: setup-java-major-versions | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|         distribution: ['temurin', 'zulu', 'liberica'] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: ${{ matrix.distribution }} | ||||
|           java-version: | | ||||
|             11 | ||||
|             17 | ||||
|       - name: Verify Java env variables | ||||
|         run: | | ||||
|           $versionsArr = "11","17" | ||||
|           foreach ($version in $versionsArr) | ||||
|           { | ||||
|             $envName = "JAVA_HOME_${version}_${env:RUNNER_ARCH}" | ||||
|             $JavaVersionPath = [Environment]::GetEnvironmentVariable($envName) | ||||
|             if (-not (Test-Path "$JavaVersionPath")) {  | ||||
|               Write-Host "$envName is not found" | ||||
|               exit 1 | ||||
|             }  | ||||
|           } | ||||
|         shell: pwsh | ||||
|       - name: Verify Java | ||||
|         run: bash __tests__/verify-java.sh "17" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
|  | ||||
|   setup-java-ea-versions-zulu: | ||||
|     name: zulu ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }} | ||||
|     needs: setup-java-major-minor-versions | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|         version: ['17-ea', '15.0.0-ea.14'] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           java-version: ${{ matrix.version }} | ||||
|           distribution: zulu | ||||
|       - name: Verify Java | ||||
|         run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
|  | ||||
|   setup-java-ea-versions-temurin: | ||||
|     name: temurin ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }} | ||||
|     needs: setup-java-major-minor-versions | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|         version: ['17-ea'] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           java-version: ${{ matrix.version }} | ||||
|           distribution: temurin | ||||
|       - name: Verify Java | ||||
|         run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
|  | ||||
|   setup-java-custom-package-type: | ||||
|     name: ${{ matrix.distribution }} ${{ matrix.version }} (${{ matrix.java-package }}-x64) - ${{ matrix.os }} | ||||
|     needs: setup-java-major-minor-versions | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-latest] | ||||
|         distribution: ['temurin', 'zulu', 'liberica'] | ||||
|         java-package: ['jre'] | ||||
|         version: ['17.0'] | ||||
|         include: | ||||
|           - distribution: 'zulu' | ||||
|             java-package: jre+fx | ||||
|             version: '8' | ||||
|             os: ubuntu-latest | ||||
|           - distribution: 'zulu' | ||||
|             java-package: jdk+fx | ||||
|             version: '8.0.242' | ||||
|             os: ubuntu-latest | ||||
|           - distribution: 'liberica' | ||||
|             java-package: jdk+fx | ||||
|             version: '8' | ||||
|             os: ubuntu-latest | ||||
|           - distribution: 'liberica' | ||||
|             java-package: jre+fx | ||||
|             version: '11' | ||||
|             os: ubuntu-latest | ||||
|           - distribution: 'corretto' | ||||
|             java-package: jre | ||||
|             version: '8' | ||||
|             os: windows-latest | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           java-version: ${{ matrix.version }} | ||||
|           java-package: ${{ matrix.java-package }} | ||||
|           distribution: ${{ matrix.distribution }} | ||||
|       - name: Verify Java | ||||
|         run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
|  | ||||
|   # Only Liberica and Zulu provide x86 | ||||
|   setup-java-x86: | ||||
|     name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-${{ matrix.architecture }}) - ${{ matrix.os }} | ||||
|     needs: setup-java-major-minor-versions | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         # x86 is not supported on macOS | ||||
|         os: [windows-latest, ubuntu-latest] | ||||
|         distribution: ['liberica', 'zulu', 'corretto'] | ||||
|         version: ['11'] | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|       - name: setup-java | ||||
|         uses: ./ | ||||
|         id: setup-java | ||||
|         with: | ||||
|           distribution: ${{ matrix.distribution }} | ||||
|           java-version: ${{ matrix.version }} | ||||
|           architecture: 'x86' | ||||
|       - name: Verify Java | ||||
|         run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" | ||||
|         shell: bash | ||||
|  | ||||
|   # Only Microsoft provides AArch64. However, GitHub-hosted runners do not support this architecture. | ||||
							
								
								
									
										25
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,25 @@ | ||||
| name: Licensed | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|   pull_request: | ||||
|     branches: | ||||
|       - main | ||||
|   workflow_dispatch: | ||||
|  | ||||
| jobs: | ||||
|   test: | ||||
|     runs-on: ubuntu-latest | ||||
|     name: Check licenses | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - run: npm ci | ||||
|       - name: Install licensed | ||||
|         run: | | ||||
|           cd $RUNNER_TEMP | ||||
|           curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.4.4/licensed-3.4.4-linux-x64.tar.gz | ||||
|           sudo tar -xzf licensed.tar.gz | ||||
|           sudo mv licensed /usr/local/bin/licensed | ||||
|       - run: licensed status | ||||
							
								
								
									
										28
									
								
								.github/workflows/release-new-action-version.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								.github/workflows/release-new-action-version.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,28 @@ | ||||
| name: Release new action version | ||||
| on: | ||||
|   release: | ||||
|     types: [released] | ||||
|   workflow_dispatch: | ||||
|     inputs: | ||||
|       TAG_NAME: | ||||
|         description: 'Tag name that the major tag will point to' | ||||
|         required: true | ||||
|  | ||||
| env: | ||||
|   TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} | ||||
| permissions: | ||||
|   contents: write | ||||
|  | ||||
| jobs: | ||||
|   update_tag: | ||||
|     name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes | ||||
|     environment: | ||||
|       name: releaseNewActionVersion | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|     - name: Update the ${{ env.TAG_NAME }} tag | ||||
|       id: update-major-tag | ||||
|       uses: actions/publish-action@v0.1.0 | ||||
|       with: | ||||
|         source-tag: ${{ env.TAG_NAME }} | ||||
|         slack-webhook: ${{ secrets.SLACK_WEBHOOK }} | ||||
							
								
								
									
										26
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							| @ -1,26 +0,0 @@ | ||||
| name: Main workflow | ||||
| on: [push] | ||||
| jobs: | ||||
|   run: | ||||
|     name: Run | ||||
|     runs-on: ${{ matrix.operating-system }} | ||||
|     strategy: | ||||
|       matrix: | ||||
|         operating-system: [ubuntu-latest, windows-latest] | ||||
|     steps: | ||||
|     - name: Checkout | ||||
|       uses: actions/checkout@master | ||||
|  | ||||
|     - name: Set Node.js 10.x | ||||
|       uses: actions/setup-node@master | ||||
|       with: | ||||
|         version: 10.x | ||||
|  | ||||
|     - name: npm install | ||||
|       run: npm install | ||||
|  | ||||
|     - name: Lint | ||||
|       run: npm run format-check | ||||
|  | ||||
|     - name: npm test | ||||
|       run: npm test | ||||
							
								
								
									
										96
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										96
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1,2 +1,96 @@ | ||||
| !node_modules/ | ||||
| # Ignore node_modules, ncc is used to compile nodejs modules into a single file | ||||
| node_modules/ | ||||
| __tests__/runner/* | ||||
|  | ||||
| # Ignore js files that are transpiled from ts files in src/ | ||||
| lib/ | ||||
|  | ||||
| # Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore | ||||
| # Logs | ||||
| logs | ||||
| *.log | ||||
| npm-debug.log* | ||||
| yarn-debug.log* | ||||
| yarn-error.log* | ||||
| lerna-debug.log* | ||||
|  | ||||
| # Diagnostic reports (https://nodejs.org/api/report.html) | ||||
| report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||||
|  | ||||
| # Runtime data | ||||
| pids | ||||
| *.pid | ||||
| *.seed | ||||
| *.pid.lock | ||||
|  | ||||
| # Directory for instrumented libs generated by jscoverage/JSCover | ||||
| lib-cov | ||||
|  | ||||
| # Coverage directory used by tools like istanbul | ||||
| coverage | ||||
| *.lcov | ||||
|  | ||||
| # nyc test coverage | ||||
| .nyc_output | ||||
|  | ||||
| # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||||
| .grunt | ||||
|  | ||||
| # Bower dependency directory (https://bower.io/) | ||||
| bower_components | ||||
|  | ||||
| # node-waf configuration | ||||
| .lock-wscript | ||||
|  | ||||
| # Compiled binary addons (https://nodejs.org/api/addons.html) | ||||
| build/Release | ||||
|  | ||||
| # Dependency directories | ||||
| jspm_packages/ | ||||
|  | ||||
| # TypeScript v1 declaration files | ||||
| typings/ | ||||
|  | ||||
| # TypeScript cache | ||||
| *.tsbuildinfo | ||||
|  | ||||
| # Optional npm cache directory | ||||
| .npm | ||||
|  | ||||
| # Optional eslint cache | ||||
| .eslintcache | ||||
|  | ||||
| # Optional REPL history | ||||
| .node_repl_history | ||||
|  | ||||
| # Output of 'npm pack' | ||||
| *.tgz | ||||
|  | ||||
| # Yarn Integrity file | ||||
| .yarn-integrity | ||||
|  | ||||
| # dotenv environment variables file | ||||
| .env | ||||
| .env.test | ||||
|  | ||||
| # parcel-bundler cache (https://parceljs.org/) | ||||
| .cache | ||||
|  | ||||
| # next.js build output | ||||
| .next | ||||
|  | ||||
| # nuxt.js build output | ||||
| .nuxt | ||||
|  | ||||
| # vuepress build output | ||||
| .vuepress/dist | ||||
|  | ||||
| # Serverless directories | ||||
| .serverless/ | ||||
|  | ||||
| # FuseBox cache | ||||
| .fusebox/ | ||||
|  | ||||
| # DynamoDB Local files | ||||
| .dynamodb/ | ||||
| .vscode/ | ||||
|  | ||||
							
								
								
									
										15
									
								
								.licensed.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								.licensed.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,15 @@ | ||||
| sources: | ||||
|   npm: true | ||||
|  | ||||
| allowed: | ||||
|   - apache-2.0 | ||||
|   - 0bsd | ||||
|   - bsd-2-clause | ||||
|   - bsd-3-clause | ||||
|   - isc | ||||
|   - mit | ||||
|   - cc0-1.0 | ||||
|   - unlicense | ||||
|  | ||||
| reviewed: | ||||
|   npm: | ||||
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/core.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/core.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/exec.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/exec.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/glob-0.1.2.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/glob-0.1.2.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/glob-0.2.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/glob-0.2.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/http-client-1.0.11.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/http-client-1.0.11.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/http-client-2.0.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/http-client-2.0.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/io.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/io.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/tool-cache.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/tool-cache.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/abort-controller.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/abort-controller.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-asynciterator-polyfill.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-asynciterator-polyfill.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-auth.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-auth.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-http.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-http.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-lro.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-lro.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-paging.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-paging.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-tracing.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-tracing.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/logger.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/logger.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/ms-rest-js.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/ms-rest-js.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/storage-blob.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/storage-blob.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@oozcitak/dom.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@oozcitak/dom.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@oozcitak/infra.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@oozcitak/infra.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@oozcitak/url.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@oozcitak/url.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@oozcitak/util.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@oozcitak/util.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@opentelemetry/api.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@opentelemetry/api.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@types/node-14.6.2.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@types/node-14.6.2.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@types/node-16.11.25.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@types/node-16.11.25.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@types/node-fetch.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@types/node-fetch.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@types/tunnel.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@types/tunnel.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/abort-controller.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/abort-controller.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/argparse.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/argparse.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/asynckit.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/asynckit.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/balanced-match.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/balanced-match.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/brace-expansion.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/brace-expansion.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/combined-stream.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/combined-stream.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/concat-map.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/concat-map.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/delayed-stream.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/delayed-stream.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/esprima.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/esprima.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/event-target-shim.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/event-target-shim.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/events.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/events.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/form-data-2.5.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/form-data-2.5.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/form-data-3.0.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/form-data-3.0.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/form-data-4.0.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/form-data-4.0.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/ip-regex.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/ip-regex.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/js-yaml.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/js-yaml.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/lru-cache.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/lru-cache.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/mime-db.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/mime-db.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/mime-types.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/mime-types.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/minimatch.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/minimatch.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/node-fetch.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/node-fetch.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/process.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/process.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/psl.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/psl.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/punycode.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/punycode.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/sax.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/sax.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/semver-6.3.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/semver-6.3.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/semver-7.3.4.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/semver-7.3.4.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/sprintf-js.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/sprintf-js.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/tough-cookie-3.0.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/tough-cookie-3.0.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/tough-cookie-4.0.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/tough-cookie-4.0.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/tr46.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/tr46.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/tslib-1.14.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/tslib-1.14.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/tslib-2.3.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/tslib-2.3.1.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/tunnel.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/tunnel.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/universalify.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/universalify.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/uuid-3.4.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/uuid-3.4.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/uuid-8.3.2.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/uuid-8.3.2.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/webidl-conversions.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/webidl-conversions.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/whatwg-url.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/whatwg-url.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/xml2js.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/xml2js.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/xmlbuilder.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/xmlbuilder.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/xmlbuilder2.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/xmlbuilder2.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/yallist.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/yallist.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -1,11 +1,11 @@ | ||||
| { | ||||
|     "printWidth": 80, | ||||
|     "tabWidth": 2, | ||||
|     "useTabs": false, | ||||
|     "semi": true, | ||||
|     "singleQuote": true, | ||||
|     "trailingComma": "none", | ||||
|     "bracketSpacing": false, | ||||
|     "arrowParens": "avoid", | ||||
|     "parser": "typescript" | ||||
|   } | ||||
|   "printWidth": 100, | ||||
|   "tabWidth": 2, | ||||
|   "useTabs": false, | ||||
|   "semi": true, | ||||
|   "singleQuote": true, | ||||
|   "trailingComma": "none", | ||||
|   "bracketSpacing": true, | ||||
|   "arrowParens": "avoid", | ||||
|   "parser": "typescript" | ||||
| } | ||||
|  | ||||
							
								
								
									
										76
									
								
								CODE_OF_CONDUCT.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								CODE_OF_CONDUCT.md
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,76 @@ | ||||
| # Contributor Covenant Code of Conduct | ||||
|  | ||||
| ## Our Pledge | ||||
|  | ||||
| In the interest of fostering an open and welcoming environment, we as | ||||
| contributors and maintainers pledge to make participation in our project and | ||||
| our community a harassment-free experience for everyone, regardless of age, body | ||||
| size, disability, ethnicity, sex characteristics, gender identity and expression, | ||||
| level of experience, education, socio-economic status, nationality, personal | ||||
| appearance, race, religion, or sexual identity and orientation. | ||||
|  | ||||
| ## Our Standards | ||||
|  | ||||
| Examples of behavior that contributes to creating a positive environment | ||||
| include: | ||||
|  | ||||
| * Using welcoming and inclusive language | ||||
| * Being respectful of differing viewpoints and experiences | ||||
| * Gracefully accepting constructive criticism | ||||
| * Focusing on what is best for the community | ||||
| * Showing empathy towards other community members | ||||
|  | ||||
| Examples of unacceptable behavior by participants include: | ||||
|  | ||||
| * The use of sexualized language or imagery and unwelcome sexual attention or | ||||
|   advances | ||||
| * Trolling, insulting/derogatory comments, and personal or political attacks | ||||
| * Public or private harassment | ||||
| * Publishing others' private information, such as a physical or electronic | ||||
|   address, without explicit permission | ||||
| * Other conduct which could reasonably be considered inappropriate in a | ||||
|   professional setting | ||||
|  | ||||
| ## Our Responsibilities | ||||
|  | ||||
| Project maintainers are responsible for clarifying the standards of acceptable | ||||
| behavior and are expected to take appropriate and fair corrective action in | ||||
| response to any instances of unacceptable behavior. | ||||
|  | ||||
| Project maintainers have the right and responsibility to remove, edit, or | ||||
| reject comments, commits, code, wiki edits, issues, and other contributions | ||||
| that are not aligned to this Code of Conduct, or to ban temporarily or | ||||
| permanently any contributor for other behaviors that they deem inappropriate, | ||||
| threatening, offensive, or harmful. | ||||
|  | ||||
| ## Scope | ||||
|  | ||||
| This Code of Conduct applies within all project spaces, and it also applies when | ||||
| an individual is representing the project or its community in public spaces. | ||||
| Examples of representing a project or community include using an official | ||||
| project e-mail address, posting via an official social media account, or acting | ||||
| as an appointed representative at an online or offline event. Representation of | ||||
| a project may be further defined and clarified by project maintainers. | ||||
|  | ||||
| ## Enforcement | ||||
|  | ||||
| Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||||
| reported by contacting the project team at opensource+actions/setup-java@github.com. All | ||||
| complaints will be reviewed and investigated and will result in a response that | ||||
| is deemed necessary and appropriate to the circumstances. The project team is | ||||
| obligated to maintain confidentiality with regard to the reporter of an incident. | ||||
| Further details of specific enforcement policies may be posted separately. | ||||
|  | ||||
| Project maintainers who do not follow or enforce the Code of Conduct in good | ||||
| faith may face temporary or permanent repercussions as determined by other | ||||
| members of the project's leadership. | ||||
|  | ||||
| ## Attribution | ||||
|  | ||||
| This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, | ||||
| available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html | ||||
|  | ||||
| [homepage]: https://www.contributor-covenant.org | ||||
|  | ||||
| For answers to common questions about this code of conduct, see | ||||
| https://www.contributor-covenant.org/faq | ||||
							
								
								
									
										242
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										242
									
								
								README.md
									
									
									
									
									
								
							| @ -1,59 +1,239 @@ | ||||
| # setup-java | ||||
| # Setup Java | ||||
|  | ||||
| This action sets up a java environment for use in actions by: | ||||
| [](https://github.com/actions/setup-java/actions/workflows/workflow.yml) | ||||
|  | ||||
| - optionally downloading and caching a version of java by version and adding to PATH. Downloads from [Azul's Zulu distribution](http://static.azul.com/zulu/bin/). | ||||
| - registering problem matchers for error output | ||||
| The `setup-java` action provides the following functionality for GitHub Actions runners: | ||||
| - Downloading and setting up a requested version of Java. See [Usage](#Usage) for a list of supported distributions | ||||
| - Extracting and caching custom version of Java from a local file | ||||
| - Configuring runner for publishing using Apache Maven | ||||
| - Configuring runner for publishing using Gradle | ||||
| - Configuring runner for using GPG private key | ||||
| - Registering problem matchers for error output | ||||
| - Caching dependencies managed by Apache Maven | ||||
| - Caching dependencies managed by Gradle | ||||
| - Caching dependencies managed by sbt | ||||
| - [Maven Toolchains declaration](https://maven.apache.org/guides/mini/guide-using-toolchains.html) for specified JDK versions | ||||
|  | ||||
| # Usage | ||||
| This action allows you to work with Java and Scala projects. | ||||
|  | ||||
| See [action.yml](action.yml) | ||||
| ## V2 vs V1 | ||||
|  | ||||
| Basic: | ||||
| - V2 supports custom distributions and provides support for Azul Zulu OpenJDK, Eclipse Temurin and AdoptOpenJDK  out of the box. V1 supports only Azul Zulu OpenJDK | ||||
| - V2 requires you to specify distribution along with the version. V1 defaults to Azul Zulu OpenJDK, only version input is required. Follow [the migration guide](docs/switching-to-v2.md) to switch from V1 to V2 | ||||
|  | ||||
| ## Usage | ||||
|  | ||||
|   - `java-version`: _(required)_ The Java version to set up. Takes a whole or [semver](#supported-version-syntax) Java version. | ||||
|     | ||||
|   - `distribution`: _(required)_ Java [distribution](#supported-distributions). | ||||
|  | ||||
|   - `java-package`: The packaging variant of the choosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`. Default value: `jdk`. | ||||
|  | ||||
|   - `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: `x64`. | ||||
|  | ||||
|   - `jdkFile`: If a use-case requires a custom distribution setup-java uses the compressed JDK from the location pointed by this input and will take care of the installation and caching on the VM. | ||||
|  | ||||
|   - `check-latest`: Setting this option makes the action to check for the latest available version for the version spec. | ||||
|  | ||||
|   - `cache`: Quick [setup caching](#caching-packages-dependencies) for the dependencies managed through one of the predifined package managers. It can be one of "maven", "gradle" or "sbt".  | ||||
|  | ||||
|   #### Maven options | ||||
|   The action has a bunch of inputs to generate maven's [settings.xml](https://maven.apache.org/settings.html) on the fly and pass the values to Apache Maven GPG Plugin as well as Apache Maven Toolchains. See [advanced usage](docs/advanced-usage.md) for more. | ||||
|  | ||||
|   - `overwrite-settings`: By default action overwrites the settings.xml. In order to skip generation of file if it exists set this to `false`. | ||||
|  | ||||
|   - `server-id`: ID of the distributionManagement repository in the pom.xml file. Default is `github`. | ||||
|  | ||||
|   - `server-username`: Environment variable name for the username for authentication to the Apache Maven repository. Default is GITHUB_ACTOR. | ||||
|  | ||||
|   - `server-password`: Environment variable name for password or token for authentication to the Apache Maven repository. Default is GITHUB_TOKEN. | ||||
|  | ||||
|   - `settings-path`: Maven related setting to point to the diractory where the settings.xml file will be written. Default is ~/.m2. | ||||
|  | ||||
|   - `gpg-private-key`: GPG private key to import. Default is empty string.' | ||||
|  | ||||
|   - `gpg-passphrase`: description: 'Environment variable name for the GPG private key passphrase. Default is GPG_PASSPHRASE. | ||||
|  | ||||
|   - `mvn-toolchain-id`: Name of Maven Toolchain ID if the default name of `${distribution}_${java-version}` is not wanted. | ||||
|  | ||||
|   - `mvn-toolchain-vendor`: Name of Maven Toolchain Vendor if the default name of `${distribution}` is not wanted. | ||||
|  | ||||
| ### Basic Configuration | ||||
|  | ||||
| #### Eclipse Temurin | ||||
| ```yaml | ||||
| steps: | ||||
| - uses: actions/checkout@latest | ||||
| - uses: actions/setup-java@v1 | ||||
| - uses: actions/checkout@v3 | ||||
| - uses: actions/setup-java@v3 | ||||
|   with: | ||||
|     version: 9.0.4 // The JDK version to make available on the path. Takes a whole or semver Jdk version, or 1.x syntax (e.g. 1.8 => Jdk 8.x) | ||||
|     architecture: x64 // (x64 or x86) - defaults to x64 | ||||
| - run: java -cp java HelloWorldApp | ||||
|     distribution: 'temurin' # See 'Supported distributions' for available options | ||||
|     java-version: '17' | ||||
| - run: java HelloWorldApp.java | ||||
| ``` | ||||
|  | ||||
| From local file: | ||||
| #### Azul Zulu OpenJDK | ||||
| ```yaml | ||||
| steps: | ||||
| - uses: actions/checkout@master | ||||
| - uses: actions/setup-java@v1 | ||||
| - uses: actions/checkout@v3 | ||||
| - uses: actions/setup-java@v3 | ||||
|   with: | ||||
|     version: 4.0.0 | ||||
|     architecture: x64 | ||||
|     jdkFile: <path to jdkFile> // Optional - jdkFile to install java from. Useful for versions not supported by Azul | ||||
| - run: java -cp java HelloWorldApp | ||||
|     distribution: 'zulu' # See 'Supported distributions' for available options | ||||
|     java-version: '17' | ||||
| - run: java HelloWorldApp.java | ||||
| ``` | ||||
|  | ||||
| Matrix Testing: | ||||
| #### Supported version syntax | ||||
| The `java-version` input supports an exact version or a version range using [SemVer](https://semver.org/) notation: | ||||
| - major versions: `8`, `11`, `16`, `17` | ||||
| - more specific versions: `17.0`, `11.0`, `11.0.4`, `8.0.232`, `8.0.282+8` | ||||
| - early access (EA) versions: `15-ea`, `15.0.0-ea`, `15.0.0-ea.2`, `15.0.0+2-ea` | ||||
|  | ||||
| #### Supported distributions | ||||
| Currently, the following distributions are supported: | ||||
| | Keyword | Distribution | Official site | License | ||||
| |-|-|-|-| | ||||
| | `temurin` | Eclipse Temurin | [Link](https://adoptium.net/) | [Link](https://adoptium.net/about.html) | ||||
| | `zulu` | Azul Zulu OpenJDK | [Link](https://www.azul.com/downloads/zulu-community/?package=jdk) | [Link](https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/) | | ||||
| | `adopt` or `adopt-hotspot` | AdoptOpenJDK Hotspot | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) | | ||||
| | `adopt-openj9` | AdoptOpenJDK OpenJ9 | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) | | ||||
| | `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) | | ||||
| | `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq) | ||||
| | `corretto` | Amazon Corretto Build of OpenJDK | [Link](https://aws.amazon.com/corretto/) | [Link](https://aws.amazon.com/corretto/faqs/) | ||||
|  | ||||
| **NOTE:** The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions. | ||||
|  | ||||
| **NOTE:** AdoptOpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` to `temurin` to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/). | ||||
|  | ||||
| **NOTE:** For Azul Zulu OpenJDK architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness. | ||||
|  | ||||
| ### Caching packages dependencies | ||||
| The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle, maven and sbt. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files: | ||||
| - gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt` | ||||
| - maven: `**/pom.xml` | ||||
| - sbt: all sbt build definition files `**/*.sbt`, `**/project/build.properties`, `**/project/**.{scala,sbt}` | ||||
|  | ||||
| The workflow output `cache-hit` is set to indicate if an exact match was found for the key [as actions/cache does](https://github.com/actions/cache/tree/main#outputs). | ||||
|  | ||||
| The cache input is optional, and caching is turned off by default. | ||||
|  | ||||
| #### Caching gradle dependencies | ||||
| ```yaml | ||||
| steps: | ||||
| - uses: actions/checkout@v3 | ||||
| - uses: actions/setup-java@v3 | ||||
|   with: | ||||
|     distribution: 'temurin' | ||||
|     java-version: '17' | ||||
|     cache: 'gradle' | ||||
| - run: ./gradlew build --no-daemon | ||||
| ``` | ||||
|  | ||||
| #### Caching maven dependencies | ||||
| ```yaml | ||||
| steps: | ||||
| - uses: actions/checkout@v3 | ||||
| - uses: actions/setup-java@v3 | ||||
|   with: | ||||
|     distribution: 'temurin' | ||||
|     java-version: '17' | ||||
|     cache: 'maven' | ||||
| - name: Build with Maven | ||||
|   run: mvn -B package --file pom.xml | ||||
| ``` | ||||
|  | ||||
| #### Caching sbt dependencies | ||||
| ```yaml | ||||
| steps: | ||||
| - uses: actions/checkout@v3 | ||||
| - uses: actions/setup-java@v3 | ||||
|   with: | ||||
|     distribution: 'temurin' | ||||
|     java-version: '17' | ||||
|     cache: 'sbt' | ||||
| - name: Build with SBT | ||||
|   run: sbt package | ||||
| ``` | ||||
|  | ||||
| ### Check latest | ||||
|  | ||||
| In the basic examples above, the `check-latest` flag defaults to `false`. When set to `false`, the action tries to first resolve a version of Java from the local tool cache on the runner. If unable to find a specific version in the cache, the action will download a version of Java. Use the default or set `check-latest` to `false` if you prefer a faster more consistent setup experience that prioritizes trying to use the cached versions at the expense of newer versions sometimes being available for download. | ||||
|  | ||||
| If `check-latest` is set to `true`, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, the latest version of Java will be downloaded. Set `check-latest` to `true` if you want the most up-to-date version of Java to always be used. Setting `check-latest` to `true` has performance implications as downloading versions of Java is slower than using cached versions. | ||||
|  | ||||
| For Java distributions that are not cached on Hosted images, `check-latest` always behaves as `true` and downloads Java on-flight. Check out [Hosted Tool Cache](docs/advanced-usage.md#Hosted-Tool-Cache) for more details about pre-cached Java versions.   | ||||
|  | ||||
|  | ||||
| ```yaml | ||||
| steps: | ||||
| - uses: actions/checkout@v3 | ||||
| - uses: actions/setup-java@v3 | ||||
|   with: | ||||
|     distribution: 'temurin' | ||||
|     java-version: '17' | ||||
|     check-latest: true | ||||
| - run: java HelloWorldApp.java | ||||
| ``` | ||||
|  | ||||
| ### Testing against different Java versions | ||||
| ```yaml | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: ubuntu-20.04 | ||||
|     strategy: | ||||
|       matrix: | ||||
|         java: [ 1.6, 9.0.x, 12.0.2 ] | ||||
|     name: Java ${{ matrix.java }} sample | ||||
|         java: [ '8', '11', '17' ] | ||||
|     name: Java ${{ matrix.Java }} sample | ||||
|     steps: | ||||
|       - uses: actions/checkout@master | ||||
|       - uses: actions/checkout@v3 | ||||
|       - name: Setup java | ||||
|         uses: actions/setup-java@v1 | ||||
|         uses: actions/setup-java@v3 | ||||
|         with: | ||||
|           version: ${{ matrix.java }} | ||||
|           architecture: x64 | ||||
|       - run: java -cp java HelloWorldApp | ||||
|           distribution: '<distribution>' | ||||
|           java-version: ${{ matrix.java }} | ||||
|       - run: java HelloWorldApp.java | ||||
| ``` | ||||
|  | ||||
| # License | ||||
| ### Install multiple JDKs | ||||
|  | ||||
| The scripts and documentation in this project are released under the [MIT License](LICENSE) | ||||
| All versions are added to the PATH. The last version will be used and available globally. Other Java versions can be accessed through env variables with such specification as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'. | ||||
|  | ||||
| # Contributions | ||||
| ```yaml | ||||
|     steps: | ||||
|       - uses: actions/setup-java@v3 | ||||
|         with: | ||||
|           distribution: '<distribution>' | ||||
|           java-version: | | ||||
|             8 | ||||
|             11 | ||||
|             15 | ||||
| ``` | ||||
|  | ||||
| Contributions are welcome!  See [Contributor's Guide](docs/contributors.md) | ||||
| ### Using Maven Toolchains | ||||
| In the example above multiple JDKs are installed for the same job. The result after the last JDK is installed is a Maven Toolchains declaration containing references to all three JDKs. The values for `id`, `version`, and `vendor` of the individual Toolchain entries are the given input values for `distribution` and `java-version` (`vendor` being the combination of `${distribution}_${java-version}`) by default. | ||||
|  | ||||
| ### Advanced Configuration | ||||
|  | ||||
| - [Selecting a Java distribution](docs/advanced-usage.md#Selecting-a-Java-distribution) | ||||
|   - [Eclipse Temurin](docs/advanced-usage.md#Eclipse-Temurin) | ||||
|   - [Adopt](docs/advanced-usage.md#Adopt) | ||||
|   - [Zulu](docs/advanced-usage.md#Zulu) | ||||
|   - [Liberica](docs/advanced-usage.md#Liberica) | ||||
|   - [Microsoft](docs/advanced-usage.md#Microsoft) | ||||
|   - [Amazon Corretto](docs/advanced-usage.md#Amazon-Corretto) | ||||
| - [Installing custom Java package type](docs/advanced-usage.md#Installing-custom-Java-package-type) | ||||
| - [Installing custom Java architecture](docs/advanced-usage.md#Installing-custom-Java-architecture) | ||||
| - [Installing custom Java distribution from local file](docs/advanced-usage.md#Installing-Java-from-local-file) | ||||
| - [Testing against different Java distributions](docs/advanced-usage.md#Testing-against-different-Java-distributions) | ||||
| - [Testing against different platforms](docs/advanced-usage.md#Testing-against-different-platforms) | ||||
| - [Publishing using Apache Maven](docs/advanced-usage.md#Publishing-using-Apache-Maven) | ||||
| - [Publishing using Gradle](docs/advanced-usage.md#Publishing-using-Gradle) | ||||
| - [Hosted Tool Cache](docs/advanced-usage.md#Hosted-Tool-Cache) | ||||
| - [Modifying Maven Toolchains](docs/advanced-usage.md#Modifying-Maven-Toolchains) | ||||
|  | ||||
| ## License | ||||
|  | ||||
| The scripts and documentation in this project are released under the [MIT License](LICENSE). | ||||
|  | ||||
| ## Contributions | ||||
|  | ||||
| Contributions are welcome! See [Contributor's Guide](docs/contributors.md) | ||||
|  | ||||
							
								
								
									
										164
									
								
								__tests__/auth.test.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										164
									
								
								__tests__/auth.test.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,164 @@ | ||||
| import io = require('@actions/io'); | ||||
| import fs = require('fs'); | ||||
| import path = require('path'); | ||||
| import * as core from '@actions/core'; | ||||
| import os from 'os'; | ||||
|  | ||||
| import * as auth from '../src/auth'; | ||||
| import { M2_DIR, MVN_SETTINGS_FILE } from '../src/constants'; | ||||
|  | ||||
| const m2Dir = path.join(__dirname, M2_DIR); | ||||
| const settingsFile = path.join(m2Dir, MVN_SETTINGS_FILE); | ||||
|  | ||||
| describe('auth tests', () => { | ||||
|   let spyOSHomedir: jest.SpyInstance; | ||||
|   let spyInfo: jest.SpyInstance; | ||||
|  | ||||
|   beforeEach(async () => { | ||||
|     await io.rmRF(m2Dir); | ||||
|     spyOSHomedir = jest.spyOn(os, 'homedir'); | ||||
|     spyOSHomedir.mockReturnValue(__dirname); | ||||
|     spyInfo = jest.spyOn(core, 'info'); | ||||
|     spyInfo.mockImplementation(() => null); | ||||
|   }, 300000); | ||||
|  | ||||
|   afterAll(async () => { | ||||
|     try { | ||||
|       await io.rmRF(m2Dir); | ||||
|     } catch { | ||||
|       console.log('Failed to remove test directories'); | ||||
|     } | ||||
|     jest.resetAllMocks(); | ||||
|     jest.clearAllMocks(); | ||||
|     jest.restoreAllMocks(); | ||||
|   }, 100000); | ||||
|  | ||||
|   it('creates settings.xml in alternate locations', async () => { | ||||
|     const id = 'packages'; | ||||
|     const username = 'UNAMI'; | ||||
|     const password = 'TOLKIEN'; | ||||
|  | ||||
|     const altHome = path.join(__dirname, 'runner', 'settings'); | ||||
|     const altSettingsFile = path.join(altHome, MVN_SETTINGS_FILE); | ||||
|     await io.rmRF(altHome); // ensure it doesn't already exist | ||||
|  | ||||
|     await auth.createAuthenticationSettings(id, username, password, altHome, true); | ||||
|  | ||||
|     expect(fs.existsSync(m2Dir)).toBe(false); | ||||
|     expect(fs.existsSync(settingsFile)).toBe(false); | ||||
|  | ||||
|     expect(fs.existsSync(altHome)).toBe(true); | ||||
|     expect(fs.existsSync(altSettingsFile)).toBe(true); | ||||
|     expect(fs.readFileSync(altSettingsFile, 'utf-8')).toEqual( | ||||
|       auth.generate(id, username, password) | ||||
|     ); | ||||
|  | ||||
|     await io.rmRF(altHome); | ||||
|   }, 100000); | ||||
|  | ||||
|   it('creates settings.xml with minimal configuration', async () => { | ||||
|     const id = 'packages'; | ||||
|     const username = 'UNAME'; | ||||
|     const password = 'TOKEN'; | ||||
|  | ||||
|     await auth.createAuthenticationSettings(id, username, password, m2Dir, true); | ||||
|  | ||||
|     expect(fs.existsSync(m2Dir)).toBe(true); | ||||
|     expect(fs.existsSync(settingsFile)).toBe(true); | ||||
|     expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(auth.generate(id, username, password)); | ||||
|   }, 100000); | ||||
|  | ||||
|   it('creates settings.xml with additional configuration', async () => { | ||||
|     const id = 'packages'; | ||||
|     const username = 'UNAME'; | ||||
|     const password = 'TOKEN'; | ||||
|     const gpgPassphrase = 'GPG'; | ||||
|  | ||||
|     await auth.createAuthenticationSettings(id, username, password, m2Dir, true, gpgPassphrase); | ||||
|  | ||||
|     expect(fs.existsSync(m2Dir)).toBe(true); | ||||
|     expect(fs.existsSync(settingsFile)).toBe(true); | ||||
|     expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual( | ||||
|       auth.generate(id, username, password, gpgPassphrase) | ||||
|     ); | ||||
|   }, 100000); | ||||
|  | ||||
|   it('overwrites existing settings.xml files', async () => { | ||||
|     const id = 'packages'; | ||||
|     const username = 'USERNAME'; | ||||
|     const password = 'PASSWORD'; | ||||
|  | ||||
|     fs.mkdirSync(m2Dir, { recursive: true }); | ||||
|     fs.writeFileSync(settingsFile, 'FAKE FILE'); | ||||
|     expect(fs.existsSync(m2Dir)).toBe(true); | ||||
|     expect(fs.existsSync(settingsFile)).toBe(true); | ||||
|  | ||||
|     await auth.createAuthenticationSettings(id, username, password, m2Dir, true); | ||||
|  | ||||
|     expect(fs.existsSync(m2Dir)).toBe(true); | ||||
|     expect(fs.existsSync(settingsFile)).toBe(true); | ||||
|     expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(auth.generate(id, username, password)); | ||||
|   }, 100000); | ||||
|  | ||||
|   it('does not overwrite existing settings.xml files', async () => { | ||||
|     const id = 'packages'; | ||||
|     const username = 'USERNAME'; | ||||
|     const password = 'PASSWORD'; | ||||
|  | ||||
|     fs.mkdirSync(m2Dir, { recursive: true }); | ||||
|     fs.writeFileSync(settingsFile, 'FAKE FILE'); | ||||
|     expect(fs.existsSync(m2Dir)).toBe(true); | ||||
|     expect(fs.existsSync(settingsFile)).toBe(true); | ||||
|  | ||||
|     await auth.createAuthenticationSettings(id, username, password, m2Dir, false); | ||||
|  | ||||
|     expect(fs.existsSync(m2Dir)).toBe(true); | ||||
|     expect(fs.existsSync(settingsFile)).toBe(true); | ||||
|     expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual('FAKE FILE'); | ||||
|   }, 100000); | ||||
|  | ||||
|   it('generates valid settings.xml with minimal configuration', () => { | ||||
|     const id = 'packages'; | ||||
|     const username = 'USER'; | ||||
|     const password = '&<>"\'\'"><&'; | ||||
|  | ||||
|     const expectedSettings = `<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||||
|   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||
|   xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||||
|   <servers> | ||||
|     <server> | ||||
|       <id>${id}</id> | ||||
|       <username>\${env.${username}}</username> | ||||
|       <password>\${env.&<>"''"><&}</password> | ||||
|     </server> | ||||
|   </servers> | ||||
| </settings>`; | ||||
|  | ||||
|     expect(auth.generate(id, username, password)).toEqual(expectedSettings); | ||||
|   }); | ||||
|  | ||||
|   it('generates valid settings.xml with additional configuration', () => { | ||||
|     const id = 'packages'; | ||||
|     const username = 'USER'; | ||||
|     const password = '&<>"\'\'"><&'; | ||||
|     const gpgPassphrase = 'PASSPHRASE'; | ||||
|  | ||||
|     const expectedSettings = `<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||||
|   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||
|   xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||||
|   <servers> | ||||
|     <server> | ||||
|       <id>${id}</id> | ||||
|       <username>\${env.${username}}</username> | ||||
|       <password>\${env.&<>"''"><&}</password> | ||||
|     </server> | ||||
|     <server> | ||||
|       <id>gpg.passphrase</id> | ||||
|       <passphrase>\${env.${gpgPassphrase}}</passphrase> | ||||
|     </server> | ||||
|   </servers> | ||||
| </settings>`; | ||||
|  | ||||
|     expect(auth.generate(id, username, password, gpgPassphrase)).toEqual(expectedSettings); | ||||
|   }); | ||||
| }); | ||||
							
								
								
									
										331
									
								
								__tests__/cache.test.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										331
									
								
								__tests__/cache.test.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,331 @@ | ||||
| import { mkdtempSync } from 'fs'; | ||||
| import { tmpdir } from 'os'; | ||||
| import { join } from 'path'; | ||||
| import { restore, save } from '../src/cache'; | ||||
| import * as fs from 'fs'; | ||||
| import * as os from 'os'; | ||||
| import * as core from '@actions/core'; | ||||
| import * as cache from '@actions/cache'; | ||||
|  | ||||
| describe('dependency cache', () => { | ||||
|   const ORIGINAL_RUNNER_OS = process.env['RUNNER_OS']; | ||||
|   const ORIGINAL_GITHUB_WORKSPACE = process.env['GITHUB_WORKSPACE']; | ||||
|   const ORIGINAL_CWD = process.cwd(); | ||||
|   let workspace: string; | ||||
|   let spyInfo: jest.SpyInstance<void, Parameters<typeof core.info>>; | ||||
|   let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>; | ||||
|   let spyDebug: jest.SpyInstance<void, Parameters<typeof core.debug>>; | ||||
|   let spySaveState: jest.SpyInstance<void, Parameters<typeof core.saveState>>; | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     workspace = mkdtempSync(join(tmpdir(), 'setup-java-cache-')); | ||||
|     switch (os.platform()) { | ||||
|       case 'darwin': | ||||
|         process.env['RUNNER_OS'] = 'macOS'; | ||||
|         break; | ||||
|       case 'win32': | ||||
|         process.env['RUNNER_OS'] = 'Windows'; | ||||
|         break; | ||||
|       case 'linux': | ||||
|         process.env['RUNNER_OS'] = 'Linux'; | ||||
|         break; | ||||
|       default: | ||||
|         throw new Error(`unknown platform: ${os.platform()}`); | ||||
|     } | ||||
|     process.chdir(workspace); | ||||
|     // This hack is necessary because @actions/glob ignores files not in the GITHUB_WORKSPACE | ||||
|     // https://git.io/Jcxig | ||||
|     process.env['GITHUB_WORKSPACE'] = projectRoot(workspace); | ||||
|   }); | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     spyInfo = jest.spyOn(core, 'info'); | ||||
|     spyInfo.mockImplementation(() => null); | ||||
|  | ||||
|     spyWarning = jest.spyOn(core, 'warning'); | ||||
|     spyWarning.mockImplementation(() => null); | ||||
|  | ||||
|     spyDebug = jest.spyOn(core, 'debug'); | ||||
|     spyDebug.mockImplementation(() => null); | ||||
|  | ||||
|     spySaveState = jest.spyOn(core, 'saveState'); | ||||
|     spySaveState.mockImplementation(() => null); | ||||
|   }); | ||||
|  | ||||
|   afterEach(() => { | ||||
|     process.chdir(ORIGINAL_CWD); | ||||
|     process.env['GITHUB_WORKSPACE'] = ORIGINAL_GITHUB_WORKSPACE; | ||||
|     process.env['RUNNER_OS'] = ORIGINAL_RUNNER_OS; | ||||
|     resetState(); | ||||
|   }); | ||||
|  | ||||
|   describe('restore', () => { | ||||
|     let spyCacheRestore: jest.SpyInstance< | ||||
|       ReturnType<typeof cache.restoreCache>, | ||||
|       Parameters<typeof cache.restoreCache> | ||||
|     >; | ||||
|  | ||||
|     beforeEach(() => { | ||||
|       spyCacheRestore = jest | ||||
|         .spyOn(cache, 'restoreCache') | ||||
|         .mockImplementation((paths: string[], primaryKey: string) => Promise.resolve(undefined)); | ||||
|       spyWarning.mockImplementation(() => null); | ||||
|     }); | ||||
|  | ||||
|     it('throws error if unsupported package manager specified', () => { | ||||
|       return expect(restore('ant')).rejects.toThrowError('unknown package manager specified: ant'); | ||||
|     }); | ||||
|  | ||||
|     describe('for maven', () => { | ||||
|       it('throws error if no pom.xml found', async () => { | ||||
|         await expect(restore('maven')).rejects.toThrowError( | ||||
|           `No file in ${projectRoot( | ||||
|             workspace | ||||
|           )} matched to [**/pom.xml], make sure you have checked out the target repository` | ||||
|         ); | ||||
|       }); | ||||
|       it('downloads cache', async () => { | ||||
|         createFile(join(workspace, 'pom.xml')); | ||||
|  | ||||
|         await restore('maven'); | ||||
|         expect(spyCacheRestore).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|         expect(spyInfo).toBeCalledWith('maven cache is not found'); | ||||
|       }); | ||||
|     }); | ||||
|     describe('for gradle', () => { | ||||
|       it('throws error if no build.gradle found', async () => { | ||||
|         await expect(restore('gradle')).rejects.toThrowError( | ||||
|           `No file in ${projectRoot( | ||||
|             workspace | ||||
|           )} matched to [**/*.gradle*,**/gradle-wrapper.properties,buildSrc/**/Versions.kt,buildSrc/**/Dependencies.kt], make sure you have checked out the target repository` | ||||
|         ); | ||||
|       }); | ||||
|       it('downloads cache based on build.gradle', async () => { | ||||
|         createFile(join(workspace, 'build.gradle')); | ||||
|  | ||||
|         await restore('gradle'); | ||||
|         expect(spyCacheRestore).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|         expect(spyInfo).toBeCalledWith('gradle cache is not found'); | ||||
|       }); | ||||
|       it('downloads cache based on build.gradle.kts', async () => { | ||||
|         createFile(join(workspace, 'build.gradle.kts')); | ||||
|  | ||||
|         await restore('gradle'); | ||||
|         expect(spyCacheRestore).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|         expect(spyInfo).toBeCalledWith('gradle cache is not found'); | ||||
|       }); | ||||
|     }); | ||||
|     it('downloads cache based on buildSrc/Versions.kt', async () => { | ||||
|       createDirectory(join(workspace, 'buildSrc')); | ||||
|       createFile(join(workspace, 'buildSrc', 'Versions.kt')); | ||||
|  | ||||
|       await restore('gradle'); | ||||
|       expect(spyCacheRestore).toBeCalled(); | ||||
|       expect(spyWarning).not.toBeCalled(); | ||||
|       expect(spyInfo).toBeCalledWith('gradle cache is not found'); | ||||
|     }); | ||||
|     describe('for sbt', () => { | ||||
|       it('throws error if no build.sbt found', async () => { | ||||
|         await expect(restore('sbt')).rejects.toThrowError( | ||||
|           `No file in ${projectRoot( | ||||
|             workspace | ||||
|           )} matched to [**/*.sbt,**/project/build.properties,**/project/**.{scala,sbt}], make sure you have checked out the target repository` | ||||
|         ); | ||||
|       }); | ||||
|       it('downloads cache', async () => { | ||||
|         createFile(join(workspace, 'build.sbt')); | ||||
|  | ||||
|         await restore('sbt'); | ||||
|         expect(spyCacheRestore).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|         expect(spyInfo).toBeCalledWith('sbt cache is not found'); | ||||
|       }); | ||||
|     }); | ||||
|   }); | ||||
|   describe('save', () => { | ||||
|     let spyCacheSave: jest.SpyInstance< | ||||
|       ReturnType<typeof cache.saveCache>, | ||||
|       Parameters<typeof cache.saveCache> | ||||
|     >; | ||||
|  | ||||
|     beforeEach(() => { | ||||
|       spyCacheSave = jest | ||||
|         .spyOn(cache, 'saveCache') | ||||
|         .mockImplementation((paths: string[], key: string) => Promise.resolve(0)); | ||||
|       spyWarning.mockImplementation(() => null); | ||||
|     }); | ||||
|  | ||||
|     it('throws error if unsupported package manager specified', () => { | ||||
|       return expect(save('ant')).rejects.toThrowError('unknown package manager specified: ant'); | ||||
|     }); | ||||
|  | ||||
|     it('save with -1 cacheId , should not fail workflow', async () => { | ||||
|       spyCacheSave.mockImplementation(() => Promise.resolve(-1)); | ||||
|       createStateForMissingBuildFile(); | ||||
|  | ||||
|       await save('maven'); | ||||
|       expect(spyCacheSave).toBeCalled(); | ||||
|       expect(spyWarning).not.toBeCalled(); | ||||
|       expect(spyInfo).toBeCalled(); | ||||
|       expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/)); | ||||
|     }); | ||||
|  | ||||
|     it('saves with error from toolkit, should fail workflow', async () => { | ||||
|       spyCacheSave.mockImplementation(() => | ||||
|         Promise.reject(new cache.ValidationError('Validation failed')) | ||||
|       ); | ||||
|       createStateForMissingBuildFile(); | ||||
|  | ||||
|       expect.assertions(1); | ||||
|       await expect(save('maven')).rejects.toEqual(new cache.ValidationError('Validation failed')); | ||||
|     }); | ||||
|  | ||||
|     describe('for maven', () => { | ||||
|       it('uploads cache even if no pom.xml found', async () => { | ||||
|         createStateForMissingBuildFile(); | ||||
|         await save('maven'); | ||||
|         expect(spyCacheSave).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|       }); | ||||
|       it('does not upload cache if no restore run before', async () => { | ||||
|         createFile(join(workspace, 'pom.xml')); | ||||
|  | ||||
|         await save('maven'); | ||||
|         expect(spyCacheSave).not.toBeCalled(); | ||||
|         expect(spyWarning).toBeCalledWith('Error retrieving key from state.'); | ||||
|       }); | ||||
|       it('uploads cache', async () => { | ||||
|         createFile(join(workspace, 'pom.xml')); | ||||
|         createStateForSuccessfulRestore(); | ||||
|  | ||||
|         await save('maven'); | ||||
|         expect(spyCacheSave).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|         expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/)); | ||||
|       }); | ||||
|     }); | ||||
|     describe('for gradle', () => { | ||||
|       it('uploads cache even if no build.gradle found', async () => { | ||||
|         createStateForMissingBuildFile(); | ||||
|  | ||||
|         await save('gradle'); | ||||
|         expect(spyCacheSave).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|       }); | ||||
|       it('does not upload cache if no restore run before', async () => { | ||||
|         createFile(join(workspace, 'build.gradle')); | ||||
|  | ||||
|         await save('gradle'); | ||||
|         expect(spyCacheSave).not.toBeCalled(); | ||||
|         expect(spyWarning).toBeCalledWith('Error retrieving key from state.'); | ||||
|       }); | ||||
|       it('uploads cache based on build.gradle', async () => { | ||||
|         createFile(join(workspace, 'build.gradle')); | ||||
|         createStateForSuccessfulRestore(); | ||||
|  | ||||
|         await save('gradle'); | ||||
|         expect(spyCacheSave).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|         expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/)); | ||||
|       }); | ||||
|       it('uploads cache based on build.gradle.kts', async () => { | ||||
|         createFile(join(workspace, 'build.gradle.kts')); | ||||
|         createStateForSuccessfulRestore(); | ||||
|  | ||||
|         await save('gradle'); | ||||
|         expect(spyCacheSave).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|         expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/)); | ||||
|       }); | ||||
|       it('uploads cache based on buildSrc/Versions.kt', async () => { | ||||
|         createDirectory(join(workspace, 'buildSrc')); | ||||
|         createFile(join(workspace, 'buildSrc', 'Versions.kt')); | ||||
|         createStateForSuccessfulRestore(); | ||||
|  | ||||
|         await save('gradle'); | ||||
|         expect(spyCacheSave).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|         expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/)); | ||||
|       }); | ||||
|     }); | ||||
|     describe('for sbt', () => { | ||||
|       it('uploads cache even if no build.sbt found', async () => { | ||||
|         createStateForMissingBuildFile(); | ||||
|         await save('sbt'); | ||||
|         expect(spyCacheSave).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|       }); | ||||
|       it('does not upload cache if no restore run before', async () => { | ||||
|         createFile(join(workspace, 'build.sbt')); | ||||
|  | ||||
|         await save('sbt'); | ||||
|         expect(spyCacheSave).not.toBeCalled(); | ||||
|         expect(spyWarning).toBeCalledWith('Error retrieving key from state.'); | ||||
|       }); | ||||
|       it('uploads cache', async () => { | ||||
|         createFile(join(workspace, 'build.sbt')); | ||||
|         createStateForSuccessfulRestore(); | ||||
|  | ||||
|         await save('sbt'); | ||||
|         expect(spyCacheSave).toBeCalled(); | ||||
|         expect(spyWarning).not.toBeCalled(); | ||||
|         expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/)); | ||||
|       }); | ||||
|     }); | ||||
|   }); | ||||
| }); | ||||
|  | ||||
| function resetState() { | ||||
|   jest.spyOn(core, 'getState').mockReset(); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Create states to emulate a restore process without build file. | ||||
|  */ | ||||
| function createStateForMissingBuildFile() { | ||||
|   jest.spyOn(core, 'getState').mockImplementation(name => { | ||||
|     switch (name) { | ||||
|       case 'cache-primary-key': | ||||
|         return 'setup-java-cache-'; | ||||
|       default: | ||||
|         return ''; | ||||
|     } | ||||
|   }); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Create states to emulate a successful restore process. | ||||
|  */ | ||||
| function createStateForSuccessfulRestore() { | ||||
|   jest.spyOn(core, 'getState').mockImplementation(name => { | ||||
|     switch (name) { | ||||
|       case 'cache-primary-key': | ||||
|         return 'setup-java-cache-primary-key'; | ||||
|       case 'cache-matched-key': | ||||
|         return 'setup-java-cache-matched-key'; | ||||
|       default: | ||||
|         return ''; | ||||
|     } | ||||
|   }); | ||||
| } | ||||
|  | ||||
| function createFile(path: string) { | ||||
|   core.info(`created a file at ${path}`); | ||||
|   fs.writeFileSync(path, ''); | ||||
| } | ||||
|  | ||||
| function createDirectory(path: string) { | ||||
|   core.info(`created a directory at ${path}`); | ||||
|   fs.mkdirSync(path); | ||||
| } | ||||
|  | ||||
| function projectRoot(workspace: string): string { | ||||
|   if (os.platform() === 'darwin') { | ||||
|     return `/private${workspace}`; | ||||
|   } else { | ||||
|     return workspace; | ||||
|   } | ||||
| } | ||||
							
								
								
									
										12
									
								
								__tests__/cache/gradle/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								__tests__/cache/gradle/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,12 @@ | ||||
| .gradle | ||||
| **/build/ | ||||
| !src/**/build/ | ||||
|  | ||||
| # Ignore Gradle GUI config | ||||
| gradle-app.setting | ||||
|  | ||||
| # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||||
| !gradle-wrapper.jar | ||||
|  | ||||
| # Cache of project | ||||
| .gradletasknamecache | ||||
							
								
								
									
										17
									
								
								__tests__/cache/gradle/build.gradle
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								__tests__/cache/gradle/build.gradle
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,17 @@ | ||||
| plugins { | ||||
|     id 'java' | ||||
| } | ||||
| repositories { | ||||
|     mavenCentral() | ||||
| } | ||||
| dependencies { | ||||
|     implementation 'org.codehaus.groovy:groovy:1.8.6' | ||||
| } | ||||
| tasks.register('downloadDependencies') { | ||||
|     doLast { | ||||
|         def total = configurations.compileClasspath.inject (0) { sum, file -> | ||||
|             sum + file.length() | ||||
|         } | ||||
|         println total | ||||
|     } | ||||
| } | ||||
							
								
								
									
										11
									
								
								__tests__/cache/maven/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								__tests__/cache/maven/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | ||||
| target/ | ||||
| pom.xml.tag | ||||
| pom.xml.releaseBackup | ||||
| pom.xml.versionsBackup | ||||
| pom.xml.next | ||||
| release.properties | ||||
| dependency-reduced-pom.xml | ||||
| buildNumber.properties | ||||
| .mvn/timing.properties | ||||
| # https://github.com/takari/maven-wrapper#usage-without-binary-jar | ||||
| .mvn/wrapper/maven-wrapper.jar | ||||
							
								
								
									
										16
									
								
								__tests__/cache/maven/pom.xml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								__tests__/cache/maven/pom.xml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,16 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||
|     <modelVersion>4.0.0</modelVersion> | ||||
|     <groupId>io.github.actions</groupId> | ||||
|     <artifactId>setup-java-maven-example</artifactId> | ||||
|     <version>1.0.0-SNAPSHOT</version> | ||||
|     <packaging>jar</packaging> | ||||
|     <dependencies> | ||||
|         <dependency> | ||||
|             <groupId>org.junit.jupiter</groupId> | ||||
|             <artifactId>junit-jupiter-api</artifactId> | ||||
|             <version>5.7.2</version> | ||||
|             <scope>test</scope> | ||||
|         </dependency> | ||||
|     </dependencies> | ||||
| </project> | ||||
							
								
								
									
										1
									
								
								__tests__/cache/sbt/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								__tests__/cache/sbt/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| target/ | ||||
							
								
								
									
										3
									
								
								__tests__/cache/sbt/build.sbt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								__tests__/cache/sbt/build.sbt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| ThisBuild / scalaVersion := "2.12.15" | ||||
|  | ||||
| libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2" | ||||
							
								
								
									
										1
									
								
								__tests__/cache/sbt/project/build.properties
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								__tests__/cache/sbt/project/build.properties
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| sbt.version=1.6.2 | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user
	