Skip to content

Commit af0cbc3

Browse files
committed
test: add pre-install and post-install
1 parent eb75c41 commit af0cbc3

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

.github/actions/setup-python-package/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ inputs:
1010
description: "Extras to install"
1111
required: false
1212
default: ""
13+
pre-install:
14+
description: "Shell commands to run before installing the package"
15+
required: false
16+
default: ""
1317

1418
runs:
1519
using: "composite"
@@ -25,6 +29,11 @@ runs:
2529
run: python -m pip install --upgrade pip
2630
shell: bash
2731

32+
- name: Run pre-install commands
33+
if: inputs.pre-install != ''
34+
shell: bash
35+
run: ${{ inputs.pre-install }}
36+
2837
# Download dist artifact
2938
- uses: actions/download-artifact@v4
3039
with:

.github/workflows/python-tests.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ on:
4343
required: false
4444
type: string
4545
default: "test"
46+
pre-install:
47+
required: false
48+
type: string
49+
default: ""
50+
post-install:
51+
required: false
52+
type: string
53+
default: ""
4654
secrets:
4755
codecov_token:
4856
required: false
@@ -56,6 +64,7 @@ jobs:
5664
with:
5765
python-version: ${{ inputs.python-version }}
5866
install-extras: ${{ inputs.install-extras }}
67+
pre-install: ${{ inputs.pre-install }}
5968

6069
- name: Install Qt runtime libraries
6170
if: startsWith(inputs.os, 'ubuntu') && (inputs.qt-api != '')
@@ -95,6 +104,11 @@ jobs:
95104
if: inputs.enable-coverage == 'true'
96105
run: pip install pytest-cov "coverage[toml]"
97106

107+
- name: Run post-install commands
108+
if: inputs.post-install != ''
109+
shell: bash
110+
run: ${{ inputs.post-install }}
111+
98112
- name: Run pytest
99113
if: inputs.enable-coverage != 'true'
100114
run: pytest ${{ inputs.pytest-args }} --pyargs "$DISTRO_NAME"

0 commit comments

Comments
 (0)