Skip to content

Commit

Permalink
Merge branch 'LearningOS:ch7' into ch7
Browse files Browse the repository at this point in the history
  • Loading branch information
lurenjia1213 authored Oct 23, 2024
2 parents a884843 + 687ef33 commit 8c56add
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,52 +48,3 @@ jobs:
run: |
cat output.txt | grep "Test passed" | grep -oP "\d{1,}/\d{1,}" | xargs -i echo "points={}"
cat output.txt | grep "Test passed" | grep -oP "\d{1,}/\d{1,}" | xargs -i echo "points={}" >> $GITHUB_OUTPUT
deploy:
if: github.repository != 'LearningOS/rCore-Camp-Code-2024A'
name: Deploy to pages
needs: basic-test
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
continue-on-error: true
with:
ref: 'gh-pages'
- name: Save Log File
uses: yfblock/multi-rank-log@main
with:
public-dir: classroom
points: ${{ needs.basic-test.outputs.points }}
- name: GitHub Pages
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: ./classroom
keep_history: true
env:
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

0 comments on commit 8c56add

Please sign in to comment.