Skip to content

Commit a7f8088

Browse files
committed
Add GitHub action to test Python venv
1 parent 5d8436e commit a7f8088

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Check Python venv virtual environment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
# Only watch changes related to Python virtual environment venv
8+
paths:
9+
- 'requirements.txt'
10+
- 'scripts/activatePythonEnvironment.sh'
11+
- '.github/workflows/internal-check-python-venv-support.yml' # or when this file changed
12+
13+
jobs:
14+
check-python-venv-environment:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
include:
19+
- os: ubuntu-22.04
20+
python: 3.12
21+
22+
steps:
23+
- name: Checkout GIT Repository
24+
uses: actions/checkout@v4
25+
26+
- name: (Python Setup) Use version ${{ matrix.python }} with venv environment management module
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python }}
30+
cache: 'pip'
31+
32+
- name: Create, activate, install and check virtual environment
33+
run: |
34+
./scripts/activatePythonEnvironment.sh
35+
pip install --dry-run --no-deps --requirement "./requirements.txt" 2>/dev/null | grep -q "Would install" || return 1
36+
37+
- name: TODO Delete DRAFT Check the opposite
38+
run: |
39+
./scripts/activatePythonEnvironment.sh
40+
pip install --dry-run --no-deps --requirement "./requirements.txt" 2>/dev/null | grep -q "Already satisfied" || return 1

0 commit comments

Comments
 (0)