diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ceb4f3b..83853f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,4 +71,29 @@ jobs: build_dir: ./classroom keep_history: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: check score + env: + course_id: ${{ secrets.RCORE_2024_AUTUMN_COURSE_ID }} + post_api: ${{ secrets.RUSTLINGS_2024_AUTUMN_POST_API }} + run: | + score=$(( $(grep -o 'ch' classroom/latest.json | wc -l) * 100)) + cat classroom/latest.json + echo $score + + github_user="${{ github.actor }}" + + # 生成 JSON 结果 + score_json=$(jq -n \ + --arg channel "github" \ + --argjson courseId "$course_id" \ + --arg name "$github_user" \ + --argjson score "$score" \ + --argjson totalScore 500 \ + '{channel: $channel, courseId: $courseId, name: $name, score: $score, totalScore: $totalScore}') + + curl -X POST https://"$post_api" \ + -H "accept: application/json;charset=utf-8" \ + -H "Content-Type: application/json" \ + -d "$score_json" \ + -v \ No newline at end of file diff --git a/.gitignore b/.gitignore index 42539ab..89ff90c 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ tools/ pushall.sh *.bak -user/* +user/ +ci-user/ diff --git a/README.md b/README.md index 1292f28..1f6c967 100644 --- a/README.md +++ b/README.md @@ -20,29 +20,34 @@ ### Build & Run +Replace `` with your github ID, and replace `` with the chapter ID. + +Notice: `` is chosen from `[1,2,3,4,5,6,7,8]` + ```bash -# setup build&run environment first -$ git clone https://github.com/LearningOS/rCore-Camp-Code-2024A.git -$ cd rCore-Camp-Code-2024A -$ git clone https://github.com/LearningOS/rCore-Tutorial-Test-2024A.git user -$ git checkout ch$ID +# +$ git clone git@github.com:LearningOS/2024a-rcore- +$ cd 2024a-rcore- +$ git clone git@github.com:LearningOS/rCore-Tutorial-Test-2024A user +$ git checkout ch $ cd os -# run OS in ch$ID $ make run ``` -Notice: $ID is from [1-9] ### Grading +Replace `` with your github ID, and replace `` with the chapter ID. + +Notice: `` is chosen from `[3,4,5,6,8]` + ```bash -# setup build&run environment first -$ git clone https://github.com/LearningOS/rCore-Camp-Code-2024A.git -$ cd rCore-Camp-Code-2024A +# Replace with your github ID +$ git clone git@github.com:LearningOS/2024a-rcore- +$ cd 2024a-rcore- $ rm -rf ci-user -$ git clone https://github.com/LearningOS/rCore-Tutorial-Checker-2024A.git ci-user -$ git clone https://github.com/LearningOS/rCore-Tutorial-Test-2024A.git ci-user/user -$ git checkout ch$ID -# check&grade OS in ch$ID with more tests -$ cd ci-user && make test CHAPTER=$ID +$ git clone git@github.com:LearningOS/rCore-Tutorial-Checker-2024A ci-user +$ git clone git@github.com:LearningOS/rCore-Tutorial-Test-2024A ci-user/user +$ git checkout ch +$ cd ci-user +$ make test CHAPTER= ``` -Notice: $ID is from [3,4,5,6,8]