Switch starter.mojo kernels and solve functions from fn to def (#240) #34
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: Deploy Challenges | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'challenges/**' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| pip install -r scripts/requirements.txt | |
| - name: Get changed challenges | |
| id: changed | |
| run: | | |
| git diff --name-only HEAD~1 HEAD | grep '^challenges/' > changed_files.txt || true | |
| if [ -s changed_files.txt ]; then | |
| # Extract unique challenge directories (e.g., challenges/easy/1_vector_add -> challenges/easy/1_vector_add) | |
| cat changed_files.txt | sed 's|\(challenges/[^/]*/[^/]*\)/.*|\1|' | sort -u > challenge_paths.txt | |
| if [ -s challenge_paths.txt ]; then | |
| echo "paths<<EOF" >> $GITHUB_OUTPUT | |
| cat challenge_paths.txt >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| fi | |
| fi | |
| - name: Deploy changed challenges | |
| if: steps.changed.outputs.paths != '' | |
| env: | |
| SERVICE_URL: ${{ secrets.LEETGPU_SERVICE_URL }} | |
| LEETGPU_API_KEY: ${{ secrets.LEETGPU_API_KEY }} | |
| run: | | |
| echo "${{ steps.changed.outputs.paths }}" | while read -r path; do | |
| if [ -d "$path" ]; then | |
| echo "Deploying $path" | |
| python scripts/update_challenges.py "$path" | |
| fi | |
| done |