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