Skip to content

Commit 78f2732

Browse files
authored
Add Transformers4Rec repo test (#1049)
* Add Transformers4Rec repo test * Add github workflow * don't install merlin dependencies * fix minor error in comments * use get-branch-name action * fix action name -> transformers4rec
1 parent 3f76a6f commit 78f2732

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

.github/workflows/cpu-t4r.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: transformers4rec
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
tags:
8+
- v*
9+
pull_request:
10+
branches: [ main ]
11+
12+
jobs:
13+
tests:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
python-version: [3.8]
18+
os: [ubuntu-latest]
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install Ubuntu packages
29+
run: |
30+
sudo apt-get update -y
31+
sudo apt-get install -y protobuf-compiler
32+
- name: Install and upgrade python packages
33+
run: |
34+
python -m pip install --upgrade pip setuptools==59.4.0 wheel tox
35+
- name: Get Branch name
36+
id: get-branch-name
37+
uses: NVIDIA-Merlin/.github/actions/branch-name@main
38+
- name: Run tests
39+
run: |
40+
branch="${{ steps.get-branch-name.outputs.branch }}"
41+
GIT_COMMIT=`git rev-parse HEAD` tox -e py38-transformers4rec-cpu -- $branch

tox.ini

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ deps =
8989
-rrequirements/base.txt
9090
-rrequirements/dev.txt
9191
commands =
92-
; the GIT_COMMIT env is the current commit of the core repo
92+
; the GIT_COMMIT env is the current commit of the models repo
9393
git clone --depth 1 --branch {posargs:main} https://github.com/NVIDIA-Merlin/systems.git systems-{env:GIT_COMMIT}
9494
python -m pip install --upgrade "./systems-{env:GIT_COMMIT}"
9595
python -m pip install --upgrade -r "./systems-{env:GIT_COMMIT}/requirements/test-cpu.txt"
@@ -99,6 +99,19 @@ commands =
9999
python -m pip install .
100100
python -m pytest -m "not notebook" systems-{env:GIT_COMMIT}/tests/unit
101101

102+
[testenv:py38-transformers4rec-cpu]
103+
passenv=GIT_COMMIT
104+
allowlist_externals = git
105+
commands =
106+
; the GIT_COMMIT env is the current commit of the models repo
107+
git clone --depth 1 --branch {posargs:main} https://github.com/NVIDIA-Merlin/Transformers4Rec.git Transformers4Rec-{env:GIT_COMMIT}
108+
python -m pip install --upgrade -r "./Transformers4Rec-{env:GIT_COMMIT}/requirements/test.txt"
109+
python -m pip install --upgrade "./Transformers4Rec-{env:GIT_COMMIT}"
110+
python -m pip install --no-deps git+https://github.com/NVIDIA-Merlin/core.git@{posargs:main}
111+
python -m pip install --no-deps git+https://github.com/NVIDIA-Merlin/dataloader.git@{posargs:main}
112+
python -m pip install --no-deps .
113+
python -m pytest Transformers4Rec-{env:GIT_COMMIT}/tests/unit
114+
102115
[testenv:docs]
103116
; Runs in: Github Actions
104117
; Generates documentation with sphinx. There are other steps in the Github Actions workflow

0 commit comments

Comments
 (0)