Nuevas resoluciones #17
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: Teacher Evaluation | |
| on: | |
| pull_request_target: | |
| branches: [ main ] | |
| types: [ opened, synchronize, reopened ] | |
| jobs: | |
| evaluate: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - name: Checkout Base Gym Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: matcom/gym | |
| path: gym-repo | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout Student Code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| path: student-repo | |
| - name: Checkout Judge Infrastructure | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: matcom/judge | |
| token: ${{ secrets.JUDGE_ACCESS_TOKEN }} | |
| path: judge-repo | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
| - name: Sync Student Code and Run Tests | |
| working-directory: judge-repo | |
| run: | | |
| # Install dependencies | |
| uv sync | |
| # Mirror student code into the judge's solutions/exercises structure | |
| mkdir -p solutions/exercises | |
| cp -rv ../student-repo/exercises/* solutions/exercises/ | |
| # Run private tests using the grader and capture markdown output | |
| uv run python src/gymnasium/grader.py --student solutions/exercises --output-format markdown > ../evaluation_summary.md | |
| # Update the leaderboard in the gym-repo | |
| uv run python src/gymnasium/leaderboard.py --gym ../gym-repo --user ${{ github.event.pull_request.user.login }} --report report.json | |
| - name: Post Comment on PR | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const fs = require('fs'); | |
| const body = fs.readFileSync('evaluation_summary.md', 'utf8'); | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: body | |
| }) | |
| - name: Commit and Push Leaderboard Updates | |
| working-directory: gym-repo | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add scores.json docs/leaderboard.md | |
| git commit -m "chore: update leaderboard [skip ci]" || echo "No changes to commit" | |
| git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main |