mirror of
				https://gitea.com/actions/setup-python.git
				synced 2025-10-31 11:48:56 +08:00 
			
		
		
		
	feature: add update-environment input (#411)
				
					
				
			This option allows to specify if the action shall update environment variables (default) or not. This allows to use the setup-python action in a composite action without side effect (except downloading/installing python if version is missing).
This commit is contained in:
		
							
								
								
									
										26
									
								
								.github/workflows/test-pypy.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								.github/workflows/test-pypy.yml
									
									
									
									
										vendored
									
									
								
							| @@ -65,3 +65,29 @@ jobs: | ||||
|           EXECUTABLE=${EXECUTABLE%%-*}  # remove any -* suffixe | ||||
|           ${EXECUTABLE} --version | ||||
|         shell: bash | ||||
|  | ||||
|   setup-pypy-noenv: | ||||
|     name: Setup PyPy ${{ matrix.pypy }} ${{ matrix.os }} (noenv) | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-latest] | ||||
|         pypy: ['pypy2.7', 'pypy3.7', 'pypy3.8', 'pypy3.9-nightly'] | ||||
|  | ||||
|     steps: | ||||
|       - name: Checkout | ||||
|         uses: actions/checkout@v3 | ||||
|  | ||||
|       - name: setup-python ${{ matrix.pypy }} | ||||
|         id: setup-python | ||||
|         uses: ./ | ||||
|         with: | ||||
|           python-version: ${{ matrix.pypy }} | ||||
|           update-environment: false | ||||
|  | ||||
|       - name: PyPy and Python version | ||||
|         run: ${{ steps.setup-python.outputs.python-path }} --version | ||||
|  | ||||
|       - name: Run simple code | ||||
|         run: ${{ steps.setup-python.outputs.python-path }} -c 'import math; print(math.factorial(5))' | ||||
|   | ||||
							
								
								
									
										25
									
								
								.github/workflows/test-python.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										25
									
								
								.github/workflows/test-python.yml
									
									
									
									
										vendored
									
									
								
							| @@ -147,3 +147,28 @@ jobs: | ||||
|  | ||||
|     - name: Run simple code | ||||
|       run: python -c 'import math; print(math.factorial(5))' | ||||
|  | ||||
|   setup-versions-noenv: | ||||
|     name: Setup ${{ matrix.python }} ${{ matrix.os }} (noenv) | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04] | ||||
|         python: ["3.7", "3.8", "3.9", "3.10"] | ||||
|     steps: | ||||
|     - name: Checkout | ||||
|       uses: actions/checkout@v3 | ||||
|  | ||||
|     - name: setup-python ${{ matrix.python }} | ||||
|       id: setup-python | ||||
|       uses: ./ | ||||
|       with: | ||||
|         python-version: ${{ matrix.python }} | ||||
|         update-environment: false | ||||
|  | ||||
|     - name: Python version | ||||
|       run: ${{ steps.setup-python.outputs.python-path }} --version | ||||
|  | ||||
|     - name: Run simple code | ||||
|       run: ${{ steps.setup-python.outputs.python-path }} -c 'import math; print(math.factorial(5))' | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Matthieu Darbois
					Matthieu Darbois