From 4de90f5a0132f8301b3aba09a113abe7e26f0433 Mon Sep 17 00:00:00 2001 From: Jarkko Jaakola Date: Wed, 25 Sep 2024 12:07:32 +0300 Subject: [PATCH] chore: update actions to use virtualenv --- .github/workflows/container-smoke-test.yml | 6 +++++- .github/workflows/lint.yml | 9 +++++++-- .github/workflows/schema.yml | 13 ++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/container-smoke-test.yml b/.github/workflows/container-smoke-test.yml index a4b582023..89eae6d26 100644 --- a/.github/workflows/container-smoke-test.yml +++ b/.github/workflows/container-smoke-test.yml @@ -18,10 +18,14 @@ jobs: fetch-depth: 0 - name: Install requirements - run: pip install . + run: | + python -m venv venv + source ./venv/bin/activate + pip install . - name: Resolve Karapace version run: | + source ./venv/bin/activate KARAPACE_VERSION=$(python -c "from karapace import version; print(version.__version__)") echo KARAPACE_VERSION=$KARAPACE_VERSION >> $GITHUB_ENV diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ed98fc671..b8f9b57c3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -44,5 +44,10 @@ jobs: - name: Install libsnappy-dev run: sudo apt install libsnappy-dev - name: Install requirements and typing requirements - run: pip install .[typing] - - run: mypy + run: | + python -m venv venv + source ./venv/bin/activate + pip --require-virtualenv install .[typing] + - run: | + source ./venv/bin/activate + mypy src diff --git a/.github/workflows/schema.yml b/.github/workflows/schema.yml index 08fbf1134..e02b5c09a 100644 --- a/.github/workflows/schema.yml +++ b/.github/workflows/schema.yml @@ -22,12 +22,19 @@ jobs: - name: Install libsnappy-dev run: sudo apt install libsnappy-dev - name: Install requirements - run: pip install . + run: | + python -m venv venv + source ./venv/bin/activate + pip install . # Compare with latest release when running on main. - - run: make schema against=$(git describe --abbrev=0 --tags) + - run: | + source ./venv/bin/activate + make schema against=$(git describe --abbrev=0 --tags) if: github.ref == 'refs/heads/main' # Compare with main when running on branches/PRs. - - run: make schema + - run: | + source ./venv/bin/activate + make schema if: github.ref != 'refs/heads/main' - run: | diff=$(git --no-pager diff)