Skip to content

Commit

Permalink
cache pipenv deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Sep 20, 2024
1 parent 2581ae0 commit 5adc29f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,27 @@ 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: |
sudo apt update
sudo apt install -y nftables iptables ipset
docker network create net-test
python3 -m pip install --upgrade pipenv wheel
cd docker/test
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 nftables iptables ipset
docker network create net-test
- name: Run functional tests
env:
CROWDSEC_TEST_VERSION: dev
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/tests_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,26 @@ jobs:
with:
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: |
cd docker/test
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 5adc29f

Please sign in to comment.