From e4f05de2350da0f1f0d8ff669938b800cae7a38c Mon Sep 17 00:00:00 2001 From: Sasha Abramowitz Date: Wed, 13 Nov 2024 18:55:07 +0200 Subject: [PATCH 1/2] chore: only run integration tests after merge --- .../workflows/{tests_linters.yaml => ci.yaml} | 9 ++--- .github/workflows/integration_tests.yaml | 35 +++++++++++++++++++ 2 files changed, 38 insertions(+), 6 deletions(-) rename .github/workflows/{tests_linters.yaml => ci.yaml} (85%) create mode 100644 .github/workflows/integration_tests.yaml diff --git a/.github/workflows/tests_linters.yaml b/.github/workflows/ci.yaml similarity index 85% rename from .github/workflows/tests_linters.yaml rename to .github/workflows/ci.yaml index 440d9aa4f..d730ba077 100644 --- a/.github/workflows/tests_linters.yaml +++ b/.github/workflows/ci.yaml @@ -1,12 +1,12 @@ -name: Tests and Linters 🧪 +name: CI 🧪 on: [ pull_request ] jobs: - tests-and-linters: + linters: name: "Python ${{ matrix.python-version }} on ubuntu-latest" runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 5 strategy: matrix: @@ -34,6 +34,3 @@ jobs: - name: Run linters 🖌️ run: pre-commit run --all-files --verbose - - - name: Run tests 🧪 - run: pytest -p no:warnings diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml new file mode 100644 index 000000000..09a55c7ec --- /dev/null +++ b/.github/workflows/integration_tests.yaml @@ -0,0 +1,35 @@ +name: Integration Tests: 🧪 + +on: + push: + branches: + - develop + +jobs: + integration-tests: + name: "Python ${{ matrix.python-version }} on ubuntu-latest" + runs-on: ubuntu-latest + timeout-minutes: 20 + + steps: + - name: Checkout mava + uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 + with: + version: "0.4.26" + enable-cache: true + cache-dependency-glob: "requirements/requirements**.txt" # invalidate cache when requirements file changes + + - uses: actions/setup-python@v5 + with: + python-version: "${{ matrix.python-version }}" + + - name: Install python dependencies 🔧 + run: uv pip install .[dev] + env: + UV_SYSTEM_PYTHON: 1 + + - name: Run integration tests 🧪 + run: pytest test/integration_test.py -p no:warnings From 03c399559afe1393377517eec4c888d79da9c4d4 Mon Sep 17 00:00:00 2001 From: Sasha Abramowitz Date: Thu, 21 Nov 2024 09:38:18 +0200 Subject: [PATCH 2/2] fix: integration test yaml and bump uv version --- .github/workflows/ci.yaml | 2 +- .github/workflows/integration_tests.yaml | 4 ++-- Dockerfile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d730ba077..f2c74cc7e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v3 with: - version: "0.4.26" + version: "0.5.4" enable-cache: true cache-dependency-glob: "requirements/requirements**.txt" # invalidate cache when requirements file changes diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index 09a55c7ec..492593a31 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -1,4 +1,4 @@ -name: Integration Tests: 🧪 +name: Integration Tests 🧪 on: push: @@ -18,7 +18,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v3 with: - version: "0.4.26" + version: "0.5.4" enable-cache: true cache-dependency-glob: "requirements/requirements**.txt" # invalidate cache when requirements file changes diff --git a/Dockerfile b/Dockerfile index e7790d345..388571e24 100755 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y git build-essential pkg-config libhdf5- # Add uv and use the system python (no need to make venv) USER root -COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv +COPY --from=ghcr.io/astral-sh/uv:0.5.4 /uv /bin/uv ENV UV_SYSTEM_PYTHON=1 WORKDIR /home/app/mava