Skip to content

Commit d489729

Browse files
committed
ci: reusable python action
Signed-off-by: Anas Nashif <[email protected]>
1 parent c4d9289 commit d489729

File tree

3 files changed

+49
-5
lines changed

3 files changed

+49
-5
lines changed

.github/workflows/assigner.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ jobs:
2929

3030
steps:
3131
- name: Install Python dependencies
32-
run: |
33-
pip install -U PyGithub>=1.55 west
34-
35-
- name: Check out source code
36-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32+
uses: uses: ./.github/workflows/python.yml
3733

3834
- name: Run assignment script
3935
env:

.github/workflows/python.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Setup Python
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ubuntu-version:
7+
description: 'Ubuntu version.'
8+
required: false
9+
default: 'ubuntu-24.04'
10+
type: string
11+
python-version:
12+
description: 'Python version.'
13+
required: false
14+
default: '3.12'
15+
type: string
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
python_env:
22+
runs-on: ${{ input.ubuntu-version }}
23+
steps:
24+
- name: Check out source code
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
27+
- name: Set up Python ${{ inputs.python-version }}
28+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
29+
with:
30+
python-version: ${{ inputs.python-version }}
31+
32+
- name: 🔧 Install common python packages
33+
run: |
34+
python -m pip install -r scripts/requirements-actions.txt

scripts/requirements-actions.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pygithub
2+
junitparser
3+
junit2html
4+
gcovr
5+
xlsxwriter
6+
ijson
7+
unidiff
8+
sh
9+
pytest
10+
pyyaml
11+
tox
12+
awscli
13+
elasticsearch
14+
west

0 commit comments

Comments
 (0)