Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit ab62c6e

Browse files
authored
Merge branch 'LearningInfiniTensor:main' into main
2 parents 0198756 + 5e69791 commit ab62c6e

File tree

1 file changed

+22
-44
lines changed

1 file changed

+22
-44
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: GitHub Classroom Workflow
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main,dev ]
66
paths-ignore:
77
- 'README.md'
88
pull_request:
@@ -12,8 +12,8 @@ on:
1212
env:
1313
CARGO_TERM_COLOR: always
1414
TZ: Asia/Shanghai # 设置时区
15-
ENCODED_API_URL: "aHR0cHM6Ly9hcGkubGVhcm5pbmdjYW1wLmNuL3dlYi9hcGkvY291cnNlUmFuay9jcmVhdGVCeVRoaXJk"
16-
15+
ENCODED_API_URL: "aHR0cHM6Ly9hcGkubGVhcm5pbmdjYW1wLmNuL3dlYi9hcGkvY291cnNlUmFuay9jcmVhdGVCeVRoaXJkVG9rZW4="
16+
TROKEN: "OTdEamJRRFloc3NoNUFOeTNqaDV3N005WWVmV20wWWM="
1717
jobs:
1818
initialize:
1919
name: Initialize Submodules and Check for Experiments
@@ -23,16 +23,21 @@ jobs:
2323
run_cxx: ${{ steps.check.outputs.run_cxx }}
2424
run_test: ${{ steps.check.outputs.run_test }}
2525
api_url: ${{ steps.decode_api_url.outputs.url }}
26+
token: ${{ steps.decode_token.outputs.token }}
2627
run_project1: ${{ steps.check.outputs.run_project1 }}
2728
run_project2: ${{ steps.check.outputs.run_project2 }}
2829
steps:
29-
- uses: actions/checkout@v3
30+
- uses: actions/checkout@v4
3031
with:
3132
submodules: recursive # 初始化和更新子模块
3233
- name: Decode API URL
3334
id: decode_api_url
3435
run: |
35-
echo "url=$(echo "$ENCODED_API_URL" | base64 --decode)" >> "$GITHUB_OUTPUT"
36+
echo "url=$(echo "$ENCODED_API_URL" | base64 --decode)" >> "$GITHUB_OUTPUT"
37+
- name: Decode Token
38+
id: decode_token
39+
run: |
40+
echo "token=$(echo "$TROKEN" | base64 --decode)" >> "$GITHUB_OUTPUT"
3641
- name: Check for Rustlings, C++ Experiments and Other Submodules
3742
id: check
3843
run: |
@@ -46,11 +51,6 @@ jobs:
4651
else
4752
echo "::set-output name=run_cxx::false"
4853
fi
49-
if [ -d "exams" ]; then
50-
echo "::set-output name=run_test::true"
51-
else
52-
echo "::set-output name=run_test::false"
53-
fi
5454
if [ -d "TinyInfiniTensor" ]; then
5555
echo "::set-output name=run_project1::true"
5656
else
@@ -72,8 +72,9 @@ jobs:
7272
points: ${{ steps.autograding.outputs.points}}
7373
env:
7474
API_URL: ${{ needs.initialize.outputs.api_url }}
75+
TOKEN: ${{ needs.initialize.outputs.token }}
7576
steps:
76-
- uses: actions/checkout@v3
77+
- uses: actions/checkout@v4
7778
with:
7879
submodules: 'true'
7980
- name: Set up Rust environment
@@ -89,6 +90,7 @@ jobs:
8990
- name: Copy exercises directory to project root
9091
run: cp -r rustlings/exercises .
9192
- name: Run tests for rustlings
93+
#
9294
run: cargo test --test cicv --verbose
9395
continue-on-error: true
9496
- uses: yfblock/os-autograding@master
@@ -108,7 +110,7 @@ jobs:
108110
# 生成新的 JSON 内容
109111
new_json=$(jq -n \
110112
--arg channel "github" \
111-
--argjson courseId 1700 \
113+
--argjson courseId 1752 \
112114
--arg ext "aaa" \
113115
--arg name "$github_user" \
114116
--argjson score "$total_succeeds" \
@@ -129,6 +131,7 @@ jobs:
129131
curl -X POST "$API_URL" \
130132
-H "accept: application/json;charset=utf-8" \
131133
-H "Content-Type: application/json" \
134+
-H "token: $TOKEN"\
132135
-d "$(cat $summary_file)" \
133136
-v
134137
@@ -142,6 +145,7 @@ jobs:
142145
points: ${{ steps.autograding.outputs.points}}
143146
env:
144147
API_URL: ${{ needs.initialize.outputs.api_url }}
148+
TOKEN: ${{ needs.initialize.outputs.token }}
145149
steps:
146150
- name: Checkout code
147151
uses: actions/checkout@v4
@@ -212,7 +216,7 @@ jobs:
212216
# 生成新的 JSON 内容
213217
new_json=$(jq -n \
214218
--arg channel "github" \
215-
--argjson courseId 1699 \
219+
--argjson courseId 1751 \
216220
--arg ext "aaa" \
217221
--arg name "$cxx_user" \
218222
--argjson score "$total_succeeds" \
@@ -233,37 +237,9 @@ jobs:
233237
curl -X POST "$API_URL" \
234238
-H "accept: application/json;charset=utf-8" \
235239
-H "Content-Type: application/json" \
240+
-H "token: $TOKEN"\
236241
-d "$(cat $summary_file)" \
237242
-v
238-
239-
test:
240-
name: Test Job for Other Submodules
241-
needs: initialize
242-
if: ${{ needs.initialize.outputs.run_test == 'true' }}
243-
runs-on: ubuntu-latest
244-
env:
245-
API_URL: ${{ needs.initialize.outputs.api_url }}
246-
247-
steps:
248-
- name: Checkout code
249-
uses: actions/checkout@v3
250-
with:
251-
submodules: 'true'
252-
- name: Post summary JSON to remote API
253-
run: |
254-
curl -X POST "$API_URL" \
255-
-H "accept: application/json;charset=utf-8" \
256-
-H "Content-Type: application/json" \
257-
-d '{
258-
"channel": "github",
259-
"courseId": 1698,
260-
"ext": "aaa",
261-
"name": "${{ github.actor }}",
262-
"score": 1,
263-
"totalScore": 23
264-
}' \
265-
-v
266-
267243
TinyInfiniTensor:
268244
name: TinyInfiniTensor Autograding
269245
needs: initialize
@@ -276,7 +252,7 @@ jobs:
276252
API_URL: ${{ needs.initialize.outputs.api_url }}
277253
steps:
278254
- name: Checkout code
279-
uses: actions/checkout@v3
255+
uses: actions/checkout@v4
280256
with:
281257
submodules: recursive
282258
- name: Build TinyInfiniTensor
@@ -399,8 +375,9 @@ jobs:
399375
points: ${{ steps.autograding.outputs.points}}
400376
env:
401377
API_URL: ${{ needs.initialize.outputs.api_url }}
378+
TOKEN: ${{ needs.initialize.outputs.token }}
402379
steps:
403-
- uses: actions/checkout@v3
380+
- uses: actions/checkout@v4
404381
with:
405382
submodules: 'true'
406383
- name: Set up Rust environment for learning-lm-rs
@@ -519,5 +496,6 @@ jobs:
519496
curl -X POST "$API_URL" \
520497
-H "accept: application/json;charset=utf-8" \
521498
-H "Content-Type: application/json" \
499+
-H "token: $TOKEN"\
522500
-d "$(cat $summary_file)" \
523501
-v

0 commit comments

Comments
 (0)