Skip to content

Commit 0ef0f69

Browse files
committed
add action file
1 parent d1e37b3 commit 0ef0f69

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Downstream Test"
2+
description: "Test against a downstream library"
3+
inputs:
4+
package_name:
5+
description: "The downstream package name"
6+
required: true
7+
package_spec:
8+
description: "The package spec(s) to install, defaults to '<package_name>[test]"
9+
pytest_args:
10+
description: "The pytest args (defaults to '--pyargs <package_name>'"
11+
env_values:
12+
description: "Optional env values to set for test, e.g. 'FOO=BAR FIZZ=BUZZ'"
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: set up venv
17+
shell: bash
18+
run: |
19+
package_spec=${${{input.package_spec}}:-"${{inputs.package_name}}[test]"}
20+
pytest_args=${${{input.pytest_args}}:-"--pyargs ${{inputs.package_name}}"}
21+
python -m venv test_venv
22+
bin_dir=./test_venv/bin
23+
${bin_dir}/python -m pip install -U pip
24+
${bin_dir}/python -m pip install ${package_spec}
25+
${bin_dir}/python -m pip install . --force-reinstall
26+
${{ input.env_values }} ${bin_dir}/pytest ${pytest_args}
27+
rm -rf ./test_venv

0 commit comments

Comments
 (0)