-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from ToolmanP/main
Infra: introduce mdbook, grader, makefile infrastructure
- Loading branch information
Showing
59 changed files
with
1,311 additions
and
890 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: GitHub Pages | ||
|
||
on: | ||
push: | ||
sources: | ||
- "Pages/**" | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: false | ||
|
||
permissions: | ||
contents: write | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install mdbook and its preprocessors | ||
run: | | ||
mkdir mdbook | ||
tag=$(curl 'https://api.github.com/repos/toolmanp/rs-mdbook-callouts/releases/latest' | jq -r '.tag_name') | ||
url="https://github.com/toolmanp/rs-mdbook-callouts/releases/download/${tag}/mdbook-callouts-x86_64-unknown-linux-gnu.tar.gz" | ||
curl -sSL $url | tar -xz --directory=./mdbook | ||
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name') | ||
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz" | ||
curl -sSL $url | tar -xz --directory=./mdbook | ||
tag=$(curl 'https://api.github.com/repos/badboy/mdbook-toc/releases/latest' | jq -r '.tag_name') | ||
url="https://github.com/badboy/mdbook-toc/releases/download/${tag}/mdbook-toc-${tag}-x86_64-unknown-linux-gnu.tar.gz" | ||
curl -sSL $url | tar -xz --directory=./mdbook | ||
tag=$(curl 'https://api.github.com/repos/badboy/mdbook-last-changed/releases/latest' | jq -r '.tag_name') | ||
url="https://github.com/badboy/mdbook-last-changed/releases/download/${tag}/mdbook-last-changed-${tag}-x86_64-unknown-linux-gnu.tar.gz" | ||
curl -sSL $url | tar -xz --directory=./mdbook | ||
tag=$(curl 'https://api.github.com/repos/badboy/mdbook-mermaid/releases/latest' | jq -r '.tag_name') | ||
url="https://github.com/badboy/mdbook-mermaid/releases/download/${tag}/mdbook-mermaid-${tag}-x86_64-unknown-linux-gnu.tar.gz" | ||
curl -sSL $url | tar -xz --directory=./mdbook | ||
echo `pwd`/mdbook >> $GITHUB_PATH | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
- name: Build Book | ||
run: | | ||
mdbook-mermaid install ./ | ||
mdbook build | ||
touch ./book/.nojekyll | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: 'book' | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,6 @@ infer_*_report.txt | |
infer-out/ | ||
.repo/ | ||
*.tar.gz | ||
book/ | ||
**mermaid** | ||
**/index.html |
File renamed without changes
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
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -d "${CURDIR}/warehouse" ]; then | ||
if [[ -z $PROJECT ]]; then | ||
echo "Please set the PROJECT environment variable to the root directory of your project. (Makefile)" | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -d "${CURDIR}/warehouse" ]]; then | ||
echo "Please run under the root directory of this lab!" | ||
exit -1 | ||
exit 1 | ||
fi | ||
|
||
total_bombs=30 | ||
student=$(cat ${CURDIR}/student-number.txt) | ||
|
||
if [ -z $student ]; then | ||
if [[ -z $student ]]; then | ||
echo "Please enter your student number in student-number.txt at first! Otherwise you would recieve 0 POINTS!" | ||
exit -1 | ||
exit 1 | ||
fi | ||
|
||
bomb_id=$(($student%$total_bombs+1)) | ||
bomb_id=$(($student % $total_bombs + 1)) | ||
|
||
cp ${CURDIR}/warehouse/bomb-${bomb_id} ${CURDIR}/bomb |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,2 @@ | ||
LAB := 1 | ||
|
||
V := @ | ||
PROJECT_DIR := . | ||
BUILD_DIR := $(PROJECT_DIR)/build | ||
KERNEL_IMG := $(BUILD_DIR)/kernel.img | ||
QEMU := qemu-system-aarch64 | ||
_QEMU := $(PROJECT_DIR)/scripts/qemu/qemu_wrapper.sh $(QEMU) | ||
QEMU_GDB_PORT := 1234 | ||
QEMU_OPTS := -machine raspi3b -nographic -serial mon:stdio -m size=1G -kernel $(KERNEL_IMG) | ||
GDB := gdb-multiarch | ||
CHBUILD := $(PROJECT_DIR)/chbuild | ||
|
||
.PHONY: all | ||
all: build | ||
|
||
.PHONY: defconfig build clean distclean | ||
|
||
defconfig: | ||
$(V)$(CHBUILD) defconfig | ||
|
||
build: | ||
$(V)test -f $(PROJECT_DIR)/.config || $(CHBUILD) defconfig | ||
$(V)$(CHBUILD) build | ||
|
||
clean: | ||
$(V)$(CHBUILD) clean | ||
|
||
distclean: | ||
$(V)$(CHBUILD) distclean | ||
|
||
.PHONY: qemu qemu-gdb gdb | ||
|
||
qemu: | ||
$(V)$(_QEMU) $(QEMU_OPTS) | ||
|
||
qemu-gdb: | ||
$(V)$(_QEMU) -S -gdb tcp::$(QEMU_GDB_PORT) $(QEMU_OPTS) | ||
|
||
gdb: | ||
$(V)$(GDB) --nx -x $(PROJECT_DIR)/.gdbinit | ||
|
||
.PHONY: grade | ||
|
||
grade: | ||
$(V)test -f $(PROJECT_DIR)/.config && cp $(PROJECT_DIR)/.config $(PROJECT_DIR)/.config.bak | ||
$(V)$(PROJECT_DIR)/scripts/grade/lab$(LAB).sh | ||
$(V)test -f $(PROJECT_DIR)/.config.bak && mv $(PROJECT_DIR)/.config.bak $(PROJECT_DIR)/.config | ||
include $(CURDIR)/../Scripts/lab.mk |
Oops, something went wrong.