Update autograder.yml #107
This file contains 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: QMD Autograder | |
on: [push] | |
jobs: | |
check-repository-structure: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- run: pip install --upgrade pip | |
- run: pip install -e . | |
- run: python quartoquest/repo_structure_check.py | |
render-qmd: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python and Quarto environment | |
run: | | |
sudo apt-get update && sudo apt-get install -y wget | |
wget -q -O quarto.deb https://github.com/quarto-dev/quarto-cli/releases/download/v1.1.189/quarto-1.1.189-linux-amd64.deb | |
sudo dpkg -i quarto.deb | |
python -m pip install --upgrade pip | |
- name: Find .qmd file in docs and render to HTML | |
run: | | |
qmd_file=$(find docs -name "*.qmd" -print -quit) | |
if [[ -n "$qmd_file" ]]; then | |
quarto render "$qmd_file" | |
html_file="${qmd_file%.*}.html" | |
if [[ -f "$html_file" ]]; then | |
echo "Rendered HTML file: $html_file" | |
else | |
echo "Failed to render HTML file" >&2 | |
exit 1 | |
fi | |
else | |
echo "No .qmd file found in docs" | |
exit 1 | |
fi | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: rendered-html | |
path: '**/*.html' | |
run-other-autograder-tasks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- run: pip install --upgrade pip | |
- run: pip install -e . | |
- run: python quartoquest/autograder.py |