Skip to content

Commit

Permalink
CI: cache pipenv dependencies (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored Sep 20, 2024
1 parent eac51c7 commit dfe5265
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
23 changes: 13 additions & 10 deletions .github/workflows/tests_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dfe5265

Please sign in to comment.