-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.75 KB
/
classroom.yml
File metadata and controls
60 lines (49 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# For details refer https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions.
name: GitHub Classroom
on:
workflow_dispatch:
push:
branches: [ 'master', 'main' ]
paths: [ 'src/**', 'include/**' ]
env:
# CMake build type: Release, Debug, RelWithDebInfo, etc.
BUILD_TYPE: Release
defaults:
run: { shell: bash }
jobs:
autograding:
name: Autograding
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with: { submodules: 'recursive', fetch-depth: 0 }
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: CMake Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
- name: GitHub Autograding
uses: education/autograding@v1
continue-on-error: true
id: autograder
# Add the badge with the current student's score.
- name: Checkout badges branch
run: git checkout badges || git checkout -b badges
- name: Generate badge with a score
uses: markpatterson27/points-bar@v1
with:
points: ${{ steps.autograder.outputs.points }}
path: '.github/badges/points-bar.svg'
label: 'Score'
type: badge
- name: Update badge with a score
run: |
git config --local user.email "action@github.com"
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