Skip to content

Commit f42bf6f

Browse files
Create tests.yaml
1 parent f971984 commit f42bf6f

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/tests.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
10+
jobs:
11+
tests:
12+
name: Run Tests
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
29+
- name: Check for syntax errors
30+
run: |
31+
python -m compileall . -f
32+
33+
- name: Test import of modules
34+
run: |
35+
python -c "import app; print('App modules imported successfully')"
36+
37+
- name: Check application startup
38+
run: |
39+
# Create test kubeconfig dir
40+
mkdir -p ./test_kubeconfigs
41+
# Set environment variable
42+
export KUBECONFIG_DIR=./test_kubeconfigs
43+
# Test if the app can initialize (will exit quickly since no stdin)
44+
timeout 5s python app.py || code=$?; if [ $code -eq 124 ]; then echo "App started successfully"; else exit $code; fi

0 commit comments

Comments
 (0)