Test badges #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Autograding Tests | |
'on': | |
push: | |
branches: | |
- '*' | |
- '!badges' | |
workflow_dispatch: | |
repository_dispatch: | |
permissions: | |
checks: write | |
actions: read | |
contents: read | |
jobs: | |
run-autograding-tests: | |
runs-on: ubuntu-latest | |
if: github.actor != 'github-classroom[bot]' | |
steps: | |
- name: Set Locale | |
run: | | |
sudo apt-get update && sudo apt-get install tzdata locales -y | |
sudo locale-gen ru_RU.UTF-8 | |
sudo locale-gen ru_RU | |
locale -a | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: 'Task #1' | |
id: task-1 | |
uses: education/autograding-command-grader@v1 | |
with: | |
test-name: 'Task #1' | |
setup-command: '' | |
command: "./.test/task1/validate" | |
timeout: 1 | |
max-score: 1 | |
- name: 'Task #2' | |
id: task-2 | |
uses: education/autograding-command-grader@v1 | |
with: | |
test-name: 'Task #2' | |
setup-command: '' | |
command: "./.test/task2/validate" | |
timeout: 1 | |
max-score: 2 | |
- name: 'Task #3' | |
id: task-3 | |
uses: education/autograding-command-grader@v1 | |
with: | |
test-name: 'Task #3' | |
setup-command: '' | |
command: "./.test/task3/validate" | |
timeout: 1 | |
max-score: 2 | |
- name: 'Task #4' | |
id: task-4 | |
uses: education/autograding-command-grader@v1 | |
with: | |
test-name: 'Task #4' | |
setup-command: '' | |
command: "./.test/task4/validate" | |
timeout: 1 | |
max-score: 2 | |
- name: 'Task #5' | |
id: task-5 | |
uses: education/autograding-command-grader@v1 | |
with: | |
test-name: 'Task #5' | |
setup-command: '' | |
command: "./.test/task5/validate" | |
timeout: 1 | |
max-score: 3 | |
- name: Autograding Reporter | |
uses: education/autograding-grading-reporter@v1 | |
id: autograder | |
env: | |
TASK-1_RESULTS: "${{steps.task-1.outputs.result}}" | |
TASK-2_RESULTS: "${{steps.task-2.outputs.result}}" | |
TASK-3_RESULTS: "${{steps.task-3.outputs.result}}" | |
TASK-4_RESULTS: "${{steps.task-4.outputs.result}}" | |
TASK-5_RESULTS: "${{steps.task-5.outputs.result}}" | |
with: | |
runners: task-1,task-2,task-3,task-4,task-5 | |
continue-on-error: true | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
# switch to badges branch | |
- run: git checkout badges || git checkout -b badges | |
# create points bar | |
- name: points bar | |
uses: markpatterson27/points-bar@v1 | |
with: | |
points: ${{ steps.autograder.outputs.points }} | |
path: '.github/badges/points-bar.svg' | |
# commit and push badges if badges have changed | |
- name: Commit changes to points bar | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add '.github/badges/points-bar.svg' | |
git commit -m "Add/Update points bar" || exit 0 | |
git push origin badges |