Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] refined ci runner #328

Merged
merged 10 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/full-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
vers: [ {pt_ver: "1.6.0", tv_ver: "0.7.0"}, {pt_ver: "1.7.0", tv_ver: "0.8.1"}, {pt_ver: "1.8.0", tv_ver: "0.9.0"}, {pt_ver: "1.9.0", tv_ver: "0.10.0"}, {pt_ver: "1.10.0", tv_ver: "0.11.1"}, {pt_ver: "1.11.0", tv_ver: "0.12.0"}, {pt_ver: "1.12.0", tv_ver: "0.13.0"} ]
include:
- os: macos-latest
vers:
vers:
pt_ver: latest
tv_ver: latest
defaults:
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
if [[ "$TORCHVISION_VER" == "latest" && "$PYTORCH_VER" == "latest" ]]; then
conda install pytorch torchvision cpuonly pillow=6 -c pytorch
elif [[ "$TORCHVISION_VER" == "0.9."* || "$TORCHVISION_VER" == "0.10."* ]]; then
conda install pillow=6 -c conda-forge
conda install pillow=6 -c conda-forge
conda install pytorch=$PYTORCH_VER torchvision=$TORCHVISION_VER cpuonly -c pytorch
else
conda install pytorch=$PYTORCH_VER torchvision=$TORCHVISION_VER cpuonly pillow=6 -c pytorch
Expand Down Expand Up @@ -83,4 +83,4 @@ jobs:
- name: Run tests
run: |
source activate.sh
pytest tests -v
python tests/test_run.py
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
vers: [ {pt_ver: "1.6.0", tv_ver: "0.7.0"}, {pt_ver: "latest", tv_ver: "latest"} ]
include:
- os: macos-latest
vers:
vers:
pt_ver: latest
tv_ver: latest
defaults:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
if [[ "$TORCHVISION_VER" == "latest" && "$PYTORCH_VER" == "latest" ]]; then
conda install pytorch torchvision cpuonly pillow=6 -c pytorch
elif [[ "$TORCHVISION_VER" == "0.9."* || "$TORCHVISION_VER" == "0.10."* ]]; then
conda install pillow=6 -c conda-forge
conda install pillow=6 -c conda-forge
conda install pytorch=$PYTORCH_VER torchvision=$TORCHVISION_VER cpuonly -c pytorch
else
conda install pytorch=$PYTORCH_VER torchvision=$TORCHVISION_VER cpuonly pillow=6 -c pytorch
Expand Down
29 changes: 29 additions & 0 deletions tests/test_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import subprocess
import sys

import glob

# Function to run a test file
def run_test(file):
try:
subprocess.run(["pytest", "-v", file], check=True)
return True
except subprocess.CalledProcessError:
return False


if __name__ == "__main__":
# List of test files to run
test_files = glob.glob('tests/*_test.py', recursive=True)

print("Test files:")
for file in test_files:
print(f" - {file}")

pass_flag = True
for test_file in test_files:
passed = run_test(test_file)
pass_flag = pass_flag and passed

if not pass_flag:
sys.exit(1)
Loading