autograding github action
v4.1.0 ?
このGitHubアクションは、構成可能なメトリックセットに基づいてプロジェクトを自動序列にし、GitHubのプルリクエスト(または単一コミット)に関するフィードバックを提供します。このアクションを使用して、ミュンヘン大学応用科学大学での講義で学生プロジェクトを自動的に評価しています。
このアクションの結果を、プル要求の例と関連するGitHubをチェックする出力で確認できます。プルリクエストと、偽の学生プロジェクトの結果をチェックする別の実現例が表示されます。
アクションの結果は、プロジェクトの現在のステータスを示すさまざまなバッジを作成するために使用できます。このアクションは、Workspaceの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