autograding github action
v4.1.0 ?
이 GitHub Action은 구성 가능한 메트릭 세트를 기반으로 프로젝트를 자동화하고 GitHub의 풀 요청 (또는 단일 커밋)에 대한 피드백을 제공합니다. 나는이 행동을 사용하여 뮌헨 응용 과학 대학교 강의에서 학생 프로젝트를 자동으로 등급을 매겼습니다.
예제 PULL 요청과 관련 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