Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 38 additions & 34 deletions .github/workflows/autograder.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
name: Assignment autograder
on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]

# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
push:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
autograder:
name: Assignment autograder
if: startsWith(github.head_ref, 'assignment') && github.repository_owner != 'UofT-DSI'
# Single deploy job since we're just deploying
deploy:
if: |
(github.repository == 'UofT-DSI/shell' && github.ref == 'refs/heads/main') ||
(github.repository != 'UofT-DSI/shell' && github.ref == 'refs/heads/githubpages')
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- 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
uv run --python 3.12 --with pandas,tabulate,requests /tmp/autograder.py
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './03_instructional_team/githubpages'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
20 changes: 13 additions & 7 deletions 02_activities/assignments/assignment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cd newproject

mkdir analysis output
touch README.md
echo "# Project Name: DSI Consulting Inc." > README.md
touch analysis/main.py

# download client data
Expand All @@ -28,22 +29,27 @@ unzip -q rawdata.zip
# Complete assignment here

# 1. Create a directory named data

mkdir data
# 2. Move the ./rawdata directory to ./data/raw (eg. move it into ./data and rename it to raw)

mv ./rawdata ./data/raw
# 3. List the contents of the ./data/raw directory

ls -la ./data/raw
# 4. Create the directory ./data/processed,
mkdir -p ./data/processed/server_logs
mkdir -p ./data/processed/user_logs
mkdir -p ./data/processed/event_logs
# then create the following sub-directories within it: server_logs, user_logs, and event_logs

# 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs

cp ./data/raw/*server*.log ./data/processed/server_logs
# 6. Repeat the above step for user logs and event logs

cp ./data/raw/*user*.log ./data/processed/user_logs
cp ./data/raw/*event*.log ./data/processed/event_logs
# 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs

rm -rf ./data/raw/*ipaddr*
rm -rf ./data/processed/user_logs/*ipaddr*
# 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed

find ./data/processed -type f > ./data/inventory.txt

###########################################

Expand Down