├── README.md ├── action.yml └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | Easily install Python, pipenv and Pipfile packages in your GitHub Action 2 | 3 | ## Features 4 | 5 | - 🐍 Installs Python 6 | - 🔨 Installs pipenv 7 | - 📦 Installs Pipfile packages 8 | - 💽 Caches packages for future use 9 | 10 | ## Inputs 11 | 12 | * `python-version`: The version of Python to install 13 | 14 | ## Usage 15 | 16 | ```yaml 17 | name: Example action 18 | jobs: 19 | job: 20 | name: My job 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v4 25 | 26 | - name: Install Python, pipenv and Pipfile packages 27 | uses: palewire/install-python-pipenv-pipfile@v4 28 | with: 29 | python-version: 3.11 30 | 31 | - name: Do my thing 32 | run: make 33 | ``` 34 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: Install Python, pipenv and Pipfile packages 2 | description: Install Python, pipenv and Pipfile packages 3 | 4 | inputs: 5 | python-version: 6 | description: The version of Python to use 7 | required: true 8 | 9 | runs: 10 | using: "composite" 11 | steps: 12 | - id: setup-python 13 | name: Setup Python 14 | uses: actions/setup-python@v5 15 | with: 16 | python-version: ${{ inputs.python-version }} 17 | 18 | - id: install-pipenv 19 | name: Install pipenv 20 | run: | 21 | python -m pip install --upgrade --no-cache-dir pip 22 | python -m pip install --no-cache-dir pipenv 23 | shell: bash 24 | 25 | - id: cache-pipfile 26 | name: Cache Pipfile 27 | uses: actions/cache@v4 28 | with: 29 | path: ~/.local/share/virtualenvs 30 | key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }} 31 | 32 | - id: sync-pipfile 33 | name: Sync Pipfile 34 | run: pipenv sync --dev --python ${{ inputs.python-version }} 35 | shell: bash 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ben Welsh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------