From dfe5265591e177f86186e8ca4468cd7bc8a1e1ed Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:51:27 +0200 Subject: [PATCH] CI: cache pipenv dependencies (#105) --- .github/workflows/tests.yml | 20 +++++++++++--------- .github/workflows/tests_deb.yml | 23 +++++++++++++---------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6a506b6..98d44c9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.22 + go-version: '1.22' - name: Build run: | @@ -38,22 +38,24 @@ jobs: env: RICHGO_FORCE_COLOR: 1 - - name: Cache virtualenvs - id: cache-pipenv - uses: actions/cache@v4 + - name: "Setup Python" + uses: actions/setup-python@v5 with: - path: ~/.local/share/virtualenvs - key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} + python-version: "3.x" + cache: 'pipenv' - - name: Install functional test dependencies + - name: "Install python dependencies" run: | - docker network create net-test - python3 -m pip install --upgrade pipenv wheel + python -m pip install --upgrade pipenv wheel pipenv install --deploy # some tests need root, so we have to install pytest twice sudo python3 -m pip install --upgrade pipenv wheel sudo pipenv install --deploy + - name: Install functional test dependencies + run: | + docker network create net-test + - name: Run functional tests env: CROWDSEC_TEST_VERSION: dev diff --git a/.github/workflows/tests_deb.yml b/.github/workflows/tests_deb.yml index 5c55947..ac84873 100644 --- a/.github/workflows/tests_deb.yml +++ b/.github/workflows/tests_deb.yml @@ -24,24 +24,27 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.22 + go-version: '1.22' - - name: Cache virtualenvs - id: cache-pipenv - uses: actions/cache@v4 + - name: "Setup Python" + uses: actions/setup-python@v5 with: - path: ~/.local/share/virtualenvs - key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} + python-version: "3.x" + cache: 'pipenv' + + - name: "Install python dependencies" + run: | + python -m pip install --upgrade pipenv wheel + pipenv install --deploy + # some tests need root, so we have to install pytest twice + sudo python3 -m pip install --upgrade pipenv wheel + sudo pipenv install --deploy - name: Install functional test dependencies run: | sudo apt update sudo apt install -y build-essential debhelper devscripts fakeroot lintian docker network create net-test - python3 -m pip install --upgrade pipenv wheel - pipenv install --deploy - sudo python3 -m pip install --upgrade pipenv wheel - sudo pipenv install --deploy - name: Run functional tests env: