Skip to content

Commit 98e757a

Browse files
committed
add capability to target branch for unit test in cpu on tox (#58)
* add capability to target branch for unit test in cpu on tox * fix cpu ci yml file name of next stage * fix tox command in cpu ci
1 parent 858f0dd commit 98e757a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/cpu-ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ jobs:
3636
tox -re lint
3737
- name: Run unittests
3838
run: |
39-
tox -re test-cpu
39+
ref_type=${{ github.ref_type }}
40+
branch=main
41+
if [[ $ref_type == "tag"* ]]
42+
then
43+
raw=$(git branch -r --contains ${{ github.ref_name }})
44+
branch=${raw/origin\/}
45+
fi
46+
tox -e test-cpu -- $branch
4047
- name: Generate package for pypi
4148
run: |
4249
python setup.py sdist

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ deps =
1616
-rrequirements/base.txt
1717
-rrequirements/dev.txt
1818
commands =
19-
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git
20-
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/nvtabular.git
19+
echo {posargs:main}
20+
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/core.git@{posargs:main}
21+
python -m pip install --upgrade git+https://github.com/NVIDIA-Merlin/nvtabular.git@{posargs:main}
2122
python -m pip install -e .[all]
2223
python -m pip install fsspec==2022.5.0
2324
python -m pytest --cov-report term --cov=merlin -rxs tests/unit

0 commit comments

Comments
 (0)