File: action.yml

package info (click to toggle)
python-syrupy 5.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,460 kB
  • sloc: python: 6,156; makefile: 3
file content (38 lines) | stat: -rw-r--r-- 1,269 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: setup-env
description: Setup Environment
inputs:
  python-version:
    description: Version of python
    required: true
outputs:
  python-version:
    value: ${{ steps.detect-python.outputs.version }}
    description: Detected Python version.
runs:
  using: "composite"
  steps:
    - name: Detect Python Version
      id: detect-python
      run: |
        if [[ -z "${{ inputs.python-version }}" ]]; then
          echo "version=$(head -n1 .python-version | tr -d '\n')" >> $GITHUB_OUTPUT
        else
          echo "version=${{ inputs.python-version }}" >> $GITHUB_OUTPUT
        fi
      shell: bash
    - name: Detect Poetry Version
      id: detect-poetry
      run: |
        echo "version=$(head -n1 .poetry-version | tr -d '\n')" >> $GITHUB_OUTPUT
      shell: bash
    - name: Set up Python ${{ inputs.python-version }}
      uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
      with:
        python-version: ${{ inputs.python-version }}
        allow-prereleases: true
    - name: Install Poetry
      uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
      with:
        version: ${{ steps.detect-poetry.outputs.version }}
        virtualenvs-create: true
        virtualenvs-in-project: true