From 8ff7fa0501e27911a16b4b31ef326ff0b60527d9 Mon Sep 17 00:00:00 2001 From: Michael Panchenko Date: Mon, 24 Mar 2025 19:58:21 +0100 Subject: [PATCH] GH actions --- .github/workflows/common_steps.yml | 44 -------------------------- .github/workflows/lint_and_docs.yaml | 4 --- .github/workflows/pytest.yml | 16 ++++------ .github/workflows/windows_mac_test.yml | 39 ----------------------- 4 files changed, 6 insertions(+), 97 deletions(-) delete mode 100644 .github/workflows/common_steps.yml delete mode 100644 .github/workflows/windows_mac_test.yml diff --git a/.github/workflows/common_steps.yml b/.github/workflows/common_steps.yml deleted file mode 100644 index b27fbeb4..00000000 --- a/.github/workflows/common_steps.yml +++ /dev/null @@ -1,44 +0,0 @@ - -# Common step definitions to be included by other workflows -# This way we can centralize the package manager-specific steps - -# Poetry setup steps -poetry-setup: - - name: Install poetry - uses: abatilo/actions-poetry@v2 - - name: Setup a local virtual environment (if no poetry.toml file) - run: | - poetry config virtualenvs.create true --local - poetry config virtualenvs.in-project true --local - - uses: actions/cache@v3 - name: Define a cache for the virtual environment based on the dependencies lock file - with: - path: ./.venv - key: venv-${{ hashFiles('poetry.lock') }} - - name: Install the project dependencies - run: | - poetry install --with dev - -# UV setup steps -uv-setup: - - name: Install uv - run: pip install uv - - uses: actions/cache@v3 - name: Cache dependencies - with: - path: ~/.cache/uv - key: uv-${{ hashFiles('pyproject.toml') }} - - name: Install dependencies - run: | - uv venv - uv pip install -e ".[dev]" - -# Pixi setup steps -pixi-setup: - - name: Install pixi - uses: prefix-dev/setup-pixi@v0.4.1 - with: - pixi-version: v0.7.0 - - name: Install dependencies - run: pixi install - \ No newline at end of file diff --git a/.github/workflows/lint_and_docs.yaml b/.github/workflows/lint_and_docs.yaml index 100f82a1..cc39a0d4 100644 --- a/.github/workflows/lint_and_docs.yaml +++ b/.github/workflows/lint_and_docs.yaml @@ -11,10 +11,6 @@ jobs: actions: write contents: read steps: - - name: Cancel previous run - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ github.token }} - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5a3bd022..1b036c3f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,10 +10,6 @@ jobs: matrix: python-version: ["3.11"] steps: - - name: Cancel previous run - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ github.token }} - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -22,14 +18,14 @@ jobs: # Include the appropriate package manager steps based on the selection - - name: Setup and install dependencies with UV - uses: ./.github/workflows/common_steps.yml - with: - steps: uv-setup + - name: Install uv + run: curl -LsSf https://astral.sh/uv/install.sh | sh + - name: Create virtual environment + run: uv venv + - name: Install dependencies + run: uv pip install -e ".[dev]" - name: Test with pytest run: uv run poe test - - - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: diff --git a/.github/workflows/windows_mac_test.yml b/.github/workflows/windows_mac_test.yml deleted file mode 100644 index 0e20885e..00000000 --- a/.github/workflows/windows_mac_test.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Tests on Windows and MacOS - -on: [push, pull_request] - -jobs: - cpu-extra: - runs-on: ${{ matrix.os }} - if: "!contains(github.event.head_commit.message, 'ci skip')" - strategy: - matrix: - os: [macos-latest, windows-latest] - python-version: [3.11] - steps: - - name: Cancel previous run - uses: styfle/cancel-workflow-action@0.11.0 - with: - access_token: ${{ github.token }} - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - # use uv package manager - - name: Install uv - run: pip install uv - - uses: actions/cache@v3 - name: Cache dependencies - with: - path: ~/.cache/uv - key: uv-${{ hashFiles('pyproject.toml') }} - - name: Install dependencies - run: | - uv venv - uv pip install -e ".[dev]" - - name: Test with pytest - run: uv run poe test-subset -