Skip to content

Commit

Permalink
CI: cache pipenv dependencies (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored Sep 20, 2024
1 parent f52569b commit bff81d4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/tests_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,25 @@ jobs:
with:
go-version: 1.21.8

- 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:
Expand Down

0 comments on commit bff81d4

Please sign in to comment.