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: Python Palindrome Checker CI | |
| on: | |
| push: | |
| paths: | |
| - 'python/palindrome_checker/**' | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ./python/palindrome_checker | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Run Python unit tests | |
| run: python -m unittest test_main.py -v | |
| 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 |