From 6e94ae6edf266bad92d4ae3eca9edf21375b507f Mon Sep 17 00:00:00 2001 From: 29071 Date: Wed, 4 Dec 2024 18:10:04 +0800 Subject: [PATCH 1/2] # This is a combination of 3 commits. # This is the 1st commit message: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加仓库 # This is the commit message #2: fix workflows # This is the commit message #3: test --- .github/workflows/test.yml | 66 +++++++++++++------------------------- .gitmodules | 6 ++++ learning-cxx | 1 + rustlings | 1 + 4 files changed, 30 insertions(+), 44 deletions(-) create mode 100644 .gitmodules create mode 160000 learning-cxx create mode 160000 rustlings diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77bd6b1..dec6cc4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: GitHub Classroom Workflow on: push: - branches: [ main ] + branches: [ main,dev ] paths-ignore: - 'README.md' pull_request: @@ -12,8 +12,8 @@ on: env: CARGO_TERM_COLOR: always TZ: Asia/Shanghai # 设置时区 - ENCODED_API_URL: "aHR0cHM6Ly9hcGkubGVhcm5pbmdjYW1wLmNuL3dlYi9hcGkvY291cnNlUmFuay9jcmVhdGVCeVRoaXJk" - + ENCODED_API_URL: "aHR0cHM6Ly9hcGkubGVhcm5pbmdjYW1wLmNuL3dlYi9hcGkvY291cnNlUmFuay9jcmVhdGVCeVRoaXJkVG9rZW4=" + TROKEN: "OTdEamJRRFloc3NoNUFOeTNqaDV3N005WWVmV20wWWM=" jobs: initialize: name: Initialize Submodules and Check for Experiments @@ -23,16 +23,21 @@ jobs: run_cxx: ${{ steps.check.outputs.run_cxx }} run_test: ${{ steps.check.outputs.run_test }} api_url: ${{ steps.decode_api_url.outputs.url }} + token: ${{ steps.decode_token.outputs.token }} run_project1: ${{ steps.check.outputs.run_project1 }} run_project2: ${{ steps.check.outputs.run_project2 }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive # 初始化和更新子模块 - name: Decode API URL id: decode_api_url run: | - echo "url=$(echo "$ENCODED_API_URL" | base64 --decode)" >> "$GITHUB_OUTPUT" + echo "url=$(echo "$ENCODED_API_URL" | base64 --decode)" >> "$GITHUB_OUTPUT" + - name: Decode Token + id: decode_token + run: | + echo "token=$(echo "$TROKEN" | base64 --decode)" >> "$GITHUB_OUTPUT" - name: Check for Rustlings, C++ Experiments and Other Submodules id: check run: | @@ -46,11 +51,6 @@ jobs: else echo "::set-output name=run_cxx::false" fi - if [ -d "exams" ]; then - echo "::set-output name=run_test::true" - else - echo "::set-output name=run_test::false" - fi if [ -d "TinyInfiniTensor" ]; then echo "::set-output name=run_project1::true" else @@ -72,8 +72,9 @@ jobs: points: ${{ steps.autograding.outputs.points}} env: API_URL: ${{ needs.initialize.outputs.api_url }} + TOKEN: ${{ needs.initialize.outputs.token }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'true' - name: Set up Rust environment @@ -89,6 +90,7 @@ jobs: - name: Copy exercises directory to project root run: cp -r rustlings/exercises . - name: Run tests for rustlings + # run: cargo test --test cicv --verbose continue-on-error: true - uses: yfblock/os-autograding@master @@ -108,7 +110,7 @@ jobs: # 生成新的 JSON 内容 new_json=$(jq -n \ --arg channel "github" \ - --argjson courseId 1700 \ + --argjson courseId 1752 \ --arg ext "aaa" \ --arg name "$github_user" \ --argjson score "$total_succeeds" \ @@ -129,6 +131,7 @@ jobs: curl -X POST "$API_URL" \ -H "accept: application/json;charset=utf-8" \ -H "Content-Type: application/json" \ + -H "token: $TOKEN"\ -d "$(cat $summary_file)" \ -v @@ -142,6 +145,7 @@ jobs: points: ${{ steps.autograding.outputs.points}} env: API_URL: ${{ needs.initialize.outputs.api_url }} + TOKEN: ${{ needs.initialize.outputs.token }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -212,7 +216,7 @@ jobs: # 生成新的 JSON 内容 new_json=$(jq -n \ --arg channel "github" \ - --argjson courseId 1699 \ + --argjson courseId 1751 \ --arg ext "aaa" \ --arg name "$cxx_user" \ --argjson score "$total_succeeds" \ @@ -233,37 +237,9 @@ jobs: curl -X POST "$API_URL" \ -H "accept: application/json;charset=utf-8" \ -H "Content-Type: application/json" \ + -H "token: $TOKEN"\ -d "$(cat $summary_file)" \ -v - - test: - name: Test Job for Other Submodules - needs: initialize - if: ${{ needs.initialize.outputs.run_test == 'true' }} - runs-on: ubuntu-latest - env: - API_URL: ${{ needs.initialize.outputs.api_url }} - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - submodules: 'true' - - name: Post summary JSON to remote API - run: | - curl -X POST "$API_URL" \ - -H "accept: application/json;charset=utf-8" \ - -H "Content-Type: application/json" \ - -d '{ - "channel": "github", - "courseId": 1698, - "ext": "aaa", - "name": "${{ github.actor }}", - "score": 1, - "totalScore": 23 - }' \ - -v - TinyInfiniTensor: name: TinyInfiniTensor Autograding needs: initialize @@ -276,7 +252,7 @@ jobs: API_URL: ${{ needs.initialize.outputs.api_url }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Build TinyInfiniTensor @@ -399,8 +375,9 @@ jobs: points: ${{ steps.autograding.outputs.points}} env: API_URL: ${{ needs.initialize.outputs.api_url }} + TOKEN: ${{ needs.initialize.outputs.token }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'true' - name: Set up Rust environment for learning-lm-rs @@ -519,5 +496,6 @@ jobs: curl -X POST "$API_URL" \ -H "accept: application/json;charset=utf-8" \ -H "Content-Type: application/json" \ + -H "token: $TOKEN"\ -d "$(cat $summary_file)" \ -v \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0995cdd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "rustlings"] + path = rustlings + url = https://github.com/onenewcode/rustlings.git +[submodule "learning-cxx"] + path = learning-cxx + url = https://github.com/onenewcode/learning-cxx.git diff --git a/learning-cxx b/learning-cxx new file mode 160000 index 0000000..79488ef --- /dev/null +++ b/learning-cxx @@ -0,0 +1 @@ +Subproject commit 79488efb4cf10cbd293645fd69eaff631fd40cb1 diff --git a/rustlings b/rustlings new file mode 160000 index 0000000..61ec9f7 --- /dev/null +++ b/rustlings @@ -0,0 +1 @@ +Subproject commit 61ec9f739421ff209b69c45f34c79ac0784030a5 From 1f01a4a1bec871826bcb317765224609f3f6c200 Mon Sep 17 00:00:00 2001 From: 29071 Date: Wed, 4 Dec 2024 18:44:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix workflows test finsh finsh --- .gitmodules | 6 ------ learning-cxx | 1 - rustlings | 1 - 3 files changed, 8 deletions(-) delete mode 100644 .gitmodules delete mode 160000 learning-cxx delete mode 160000 rustlings diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0995cdd..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "rustlings"] - path = rustlings - url = https://github.com/onenewcode/rustlings.git -[submodule "learning-cxx"] - path = learning-cxx - url = https://github.com/onenewcode/learning-cxx.git diff --git a/learning-cxx b/learning-cxx deleted file mode 160000 index 79488ef..0000000 --- a/learning-cxx +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 79488efb4cf10cbd293645fd69eaff631fd40cb1 diff --git a/rustlings b/rustlings deleted file mode 160000 index 61ec9f7..0000000 --- a/rustlings +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 61ec9f739421ff209b69c45f34c79ac0784030a5