autograding github action
v4.1.0 ?
此GitHub操作根據可配置的指標集自動化項目,並在GitHub中就拉的請求(或單個提交)提供反饋。我使用此行動在慕尼黑應用科學大學的演講中自動對學生項目進行分級。
您可以在示例拉請求和關聯的GitHub檢查輸出中看到此操作的結果。在拉動請求中可以看到另一個現實的示例,並檢查了一個假學生項目的結果。
操作的結果可用於創建顯示項目當前狀態的各種徽章。該動作將操作結果寫入工作空間中的名為metrics.env的文件。該文件可用於使用GitHub徽章動作創建徽章。以下片段顯示瞭如何為您的項目創建幾個徽章,在我的自動上的工作流程中可以看到完整的示例。
[... Autograding, see above ... ]
- name : Write metrics to GitHub output
id : metrics
run : |
cat metrics.env >> "${GITHUB_OUTPUT}"
mkdir -p badges
- name : Generate the badge SVG image for the line coverage
uses : emibcn/[email protected]
with :
label : ' Line coverage '
status : ${{ steps.metrics.outputs.line }}%
color : ' green '
path : badges/line-coverage.svg
- name : Generate the badge SVG image for the branch coverage
uses : emibcn/[email protected]
with :
label : ' Branch coverage '
status : ${{ steps.metrics.outputs.branch }}%
color : ' green '
path : badges/branch-coverage.svg
- name : Generate the badge SVG image for the mutation coverage
uses : emibcn/[email protected]
with :
label : ' Mutation coverage '
status : ${{ steps.metrics.outputs.mutation }}%
color : ' green '
path : badges/mutation-coverage.svg
- name : Generate the badge SVG image for the style warnings
uses : emibcn/[email protected]
with :
label : ' Style warnings '
status : ${{ steps.metrics.outputs.style }}
color : ' orange '
path : badges/style-warnings.svg
- name : Generate the badge SVG image for the potential bugs
uses : emibcn/[email protected]
with :
label : ' Potential Bugs '
status : ${{ steps.metrics.outputs.bugs }}
color : ' red '
path : badges/bugs.svg
- name : Commit updated badges
continue-on-error : true
run : |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add badges/*.svg
git commit -m "Update badges with results from latest autograding" || true
- name : Push updated badges to GitHub repository
uses : ad-m/github-push-action@master
if : ${{ success() }}
with :
github_token : ${{ secrets.GITHUB_TOKEN }}
branch : main