diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 395e186..087b562 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,7 +3,7 @@ name: tests on: workflow_dispatch: push: - branches: ['main', 'dev-*', 'dev'] + branches: ["main", "dev-*", "dev"] pull_request: release: types: [published] @@ -15,26 +15,27 @@ jobs: strategy: matrix: include: - - os: 'macos-latest' - python-version: '3.9' - - os: 'windows-latest' - python-version: '3.10' - - os: 'ubuntu-latest' - python-version: '3.11' - - os: 'ubuntu-latest' - python-version: '3.12' - - os: 'ubuntu-latest' - python-version: '3.13' + - os: "macos-latest" + python-version: "3.9" + - os: "windows-latest" + python-version: "3.10" + - os: "ubuntu-latest" + python-version: "3.11" + - os: "ubuntu-latest" + python-version: "3.12" + - os: "ubuntu-latest" + python-version: "3.13" steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - name: Install uv and Python + uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install -e ".[dev, all_models]" + uv pip install --upgrade pip + uv pip install -e ".[dev, all_models]" - name: Run Tests run: | pytest -m 'not rsc_test and not docker' --cov --cov-report xml @@ -47,14 +48,15 @@ jobs: if: ${{ !github.event.pull_request.head.repo.fork }} steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - name: Install uv and Python + uses: astral-sh/setup-uv@v5 with: python-version: "3.9" - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install ".[dev]" - python -m pip install --upgrade git+https://github.com/rstudio/vetiver-python@${{ github.sha }} + uv pip install --upgrade pip + uv pip install ".[dev]" + uv pip install --upgrade git+https://github.com/rstudio/vetiver-python@${{ github.sha }} echo {{ github.sha }} - name: run Connect run: | @@ -72,42 +74,44 @@ jobs: pytest vetiver -m 'rsc_test' test-docker: - name: "Test Docker" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install ".[dev]" - python -m pip install --upgrade git+https://github.com/rstudio/vetiver-python@${{ github.sha }} - - name: run Docker - run: | - python script/setup-docker/docker.py - pip freeze > vetiver_requirements.txt - docker build -t mock . - docker run -d -v $PWD/pinsboard:/vetiver/pinsboard -p 8080:8080 mock - sleep 5 - curl -s --retry 10 --retry-connrefused http://0.0.0.0:8080 - - name: Run tests - run: | - pytest vetiver -m 'docker' + name: "Test Docker" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install uv and Python + uses: astral-sh/setup-uv@v5 + with: + python-version: "3.10" + - name: Install dependencies + run: | + uv pip install --upgrade pip + uv pip install ".[dev]" + uv pip install --upgrade git+https://github.com/rstudio/vetiver-python@${{ github.sha }} + - name: run Docker + run: | + python script/setup-docker/docker.py + pip freeze > vetiver_requirements.txt + docker build -t mock . + docker run -d -v $PWD/pinsboard:/vetiver/pinsboard -p 8080:8080 mock + sleep 5 + curl -s --retry 10 --retry-connrefused http://0.0.0.0:8080 + - name: Run tests + run: | + pytest vetiver -m 'docker' test-no-extras: name: "Test no exra ml frameworks" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - name: Install uv and Python + uses: astral-sh/setup-uv@v5 with: python-version: "3.10" - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install -e .[dev] + uv pip install --upgrade pip + uv pip install -e .[dev] - name: Run tests run: | @@ -137,15 +141,15 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v4 + - name: Install uv and Python + uses: astral-sh/setup-uv@v5 with: python-version: "3.11" - name: Install Packages shell: bash run: | - pip install ".[dev,all_models]" + uv pip install ".[dev,all_models]" - name: Run Tests shell: bash @@ -158,7 +162,8 @@ jobs: needs: [test-no-extras, tests, test-connect] steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - name: Install uv and Python + uses: astral-sh/setup-uv@v5 with: python-version: "3.10" - name: "Build Package"