Skip to content

Commit 339d7bd

Browse files
committed
update python tests workflow
1 parent e6451ec commit 339d7bd

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

.github/workflows/python_test_challenge_ci.yaml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
push:
55
paths:
66
- 'python/test_challenge/**'
7-
pull_request:
8-
paths:
9-
- 'python/test_challenge/**'
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
working-directory: ./python/test_challenge
1012

1113
jobs:
1214
test:
@@ -18,9 +20,31 @@ jobs:
1820
- name: Set up Python
1921
uses: actions/setup-python@v4
2022
with:
21-
python-version: '3.8'
23+
python-version: '3.10'
2224

2325
- name: Run unit tests
2426
run: |
2527
cd python/test_challenge
2628
python -m unittest test_main.py -v
29+
30+
points-system:
31+
runs-on: ubuntu-latest
32+
needs: test
33+
defaults:
34+
run:
35+
shell: bash
36+
working-directory: .
37+
steps:
38+
- name: Check secrets and increment points
39+
shell: bash
40+
run: |
41+
if [[ -n "${{ secrets.GKSS_LEADERBOARD_API_URL }}" && -n "${{ secrets.GKSS_LEADERBOARD_API_KEY }}" ]]; then
42+
echo "Incrementing points..."
43+
curl -X POST ${{ secrets.GKSS_LEADERBOARD_API_URL }} \
44+
-H "x-gkssunisa-api-key: ${{ secrets.GKSS_LEADERBOARD_API_KEY }}" \
45+
-H "Content-Type: application/json" \
46+
-d '{"message": "i did it! ${{ github.actor }}"}'
47+
else
48+
echo "Skipping points increment - required secrets not found"
49+
exit 1
50+
fi

0 commit comments

Comments
 (0)