-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction.yml
77 lines (61 loc) · 2.1 KB
/
action.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: stew ci
description: Launch "stew ci" on a python project
inputs:
project-name:
description: The project name, from the pyproject.toml file.
required: true
python-version:
description: The python version number, such as "3.10". See `actions/setup-python` for documentation.
required: true
poetry-version:
description: The pip constraint when installing poetry.
required: false
default: "<2.0.0"
coveo-stew-version:
description: The pip constraint when installing coveo-stew.
required: false
default: "<4"
run-stew:
description: If not "true", `stew ci` will not be ran. This is a shortcut to checkout/setup-python/poetry/stew without running it.
required: false
default: "true"
install-python:
description: Can be set to false to skip installing python.
required: false
default: "true"
python-exec:
description: The name of the python executable
required: false
default: "python"
runs:
using: 'composite'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
if: inputs.install-python == 'true'
with:
python-version: ${{ inputs.python-version }}
- name: Prepare pipx path
shell: bash
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Upgrade python tools and install pipx
shell: bash
env:
PYTHON_EXEC: ${{ inputs.python-exec }}
run: $PYTHON_EXEC -m pip install --upgrade pip wheel setuptools pipx --user --disable-pip-version-check
- name: poetry and stew
shell: bash
env:
POETRY_VERSION: ${{ inputs.poetry-version }}
COVEO_STEW_VERSION: ${{ inputs.coveo-stew-version }}
PYTHON_EXEC: ${{ inputs.python-exec }}
run: |
$PYTHON_EXEC -m pipx install "poetry$POETRY_VERSION"
$PYTHON_EXEC -m pipx inject poetry poetry-plugin-export
$PYTHON_EXEC -m pipx install "coveo-stew$COVEO_STEW_VERSION"
- name: Run stew ci
if: inputs.run-stew == 'true'
shell: bash
env:
PROJECT_NAME: ${{ inputs.project-name }}
run: stew ci $PROJECT_NAME --exact-match