diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb313c2..3b08ddb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,8 @@ name: Release +defaults: + run: + shell: bash -le {0} on: release: types: [ published ] diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 9db5482..bb0a901 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -46,10 +46,11 @@ jobs: needs: - list-test-files container: - image: 10.0.13.31:5000/modelcloud/gptqmodel:github-ci-v7 + image: 10.0.13.31:5000/nvidia/cuda:130-ubuntu22.04_1021 volumes: - - /home/ci/models:/monster/data/model - - /home/ci/models/huggingface:/github/home/.cache/huggingface + - /monster/ci/pyenv:/opt/pyenv + - /monster/ci/models:/monster/data/model + - /monster/ci/huggingface:/github/home/.cache/huggingface strategy: fail-fast: false matrix: @@ -57,8 +58,24 @@ jobs: steps: - uses: actions/checkout@v6 + - name: Print Env + run: | + env_name="logbar_unit_test_py314_${{ matrix.test_script }}" + + echo "env name: $env_name" + + if [ -d "$(pyenv root)/versions/$env_name" ]; then + echo "env exists, skip" + else + echo "creating venv..." + pyenv virtualenv 3.14 "$env_name" + fi + + pyenv local $env_name + pyenv activate $env_name + - name: install requirements - run: pip install parameterized pytest pytest-xdist + run: pip install -U parameterized pytest pytest-xdist - name: install run: pip install . diff --git a/tests/test_example.py b/tests/test_example.py index c55d09e..0fa35ef 100644 --- a/tests/test_example.py +++ b/tests/test_example.py @@ -4,20 +4,24 @@ # Contact: qubitium@modelcloud.ai, x.com/qubitium import time +import unittest from logbar import LogBar -log = LogBar.shared() -pb_fetch = log.pb(range(80)).title("Fetch").manual() -pb_train = log.pb(range(120)).title("Train").manual() +class TestExample(unittest.TestCase): + def test_example(self): + log = LogBar.shared() -for _ in pb_fetch: - pb_fetch.draw() - time.sleep(0.01) + pb_fetch = log.pb(range(80)).title("Fetch").manual() + pb_train = log.pb(range(120)).title("Train").manual() -for _ in pb_train: - pb_train.draw() - time.sleep(0.01) + for _ in pb_fetch: + pb_fetch.draw() + time.sleep(0.01) -pb_train.close() -pb_fetch.close() + for _ in pb_train: + pb_train.draw() + time.sleep(0.01) + + pb_train.close() + pb_fetch.close()