Skip to content

Assignment Revision Submission #4

Assignment Revision Submission

Assignment Revision Submission #4

Workflow file for this run

name: Assignment autograder
on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
jobs:
autograder:
name: Assignment autograder
if: startsWith(github.head_ref, 'assignment')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r 03_instructional_team/autograder/requirements.txt
- name: Setup working directory for script
run: |
UUID=$(uuidgen)
echo "UUID=$UUID" >> $GITHUB_ENV
mkdir /tmp/$UUID
cp $GITHUB_WORKSPACE/02_activities/assignments/assignment.sh /tmp/$UUID
- name: Run assignment script
run: |
bash -c "bash assignment.sh 2>&1 | tee /tmp/${{ env.UUID }}_output.txt"
working-directory: /tmp/${{ env.UUID }}
- name: Grade responses
id: grade
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO_BRANCH: ${{ github.event.pull_request.head.ref }}
WORKING_DIR: /tmp/${{ env.UUID }}
run: |
wget -O /tmp/autograder.py https://github.com/UofT-DSI/shell/raw/refs/heads/main/03_instructional_team/autograder/autograder.py
python /tmp/autograder.py