-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (47 loc) · 1.32 KB
/
cpp_test_challenge_ci.yaml
File metadata and controls
54 lines (47 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: C++ Test Challenge CI
on:
workflow_dispatch:
push:
paths:
- 'cpp/test_challenge/**'
defaults:
run:
shell: bash
working-directory: ./cpp/test_challenge
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build solution
uses: threeal/cmake-action@v2
with:
source-dir: cpp/test_challenge
build-dir: ci-build
- name: Run tests
working-directory: ci-build/
run: |
ctest --output-on-failure
points-system:
runs-on: ubuntu-latest
needs: test
defaults:
run:
shell: bash
working-directory: .
steps:
- name: Check secrets and increment points
shell: bash
run: |
if [[ -n "${{ secrets.GKSS_LEADERBOARD_API_URL }}" && -n "${{ secrets.GKSS_LEADERBOARD_API_KEY }}" ]]; then
echo "Incrementing points..."
curl -X POST ${{ secrets.GKSS_LEADERBOARD_API_URL }} \
-H "x-gkssunisa-api-key: ${{ secrets.GKSS_LEADERBOARD_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"message": "i did it! ${{ github.actor }}"}'
else
echo "Skipping points increment - required secrets not found"
exit 1
fi