feat(challenge pack 1): add new challenge packages (#1) #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: C++ Binary Search Tree CI | |
| on: | |
| push: | |
| paths: | |
| - 'cpp/binary_search_tree/**' | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./cpp/binary_search_tree | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build C++ solution | |
| uses: threeal/cmake-action@v2 | |
| with: | |
| source-dir: cpp/binary_search_tree | |
| build-dir: ci-build | |
| - name: Run C++ tests | |
| working-directory: ci-build/ | |
| run: | | |
| ctest --output-on-failure | |
| points-system: | |
| name: Award Points | |
| 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 |