Skip to content

Commit

Permalink
improve github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelLerchner committed Nov 1, 2023
1 parent d9da30f commit 35d2a65
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
tests:
- tests/**/*

presentation:
- sheet*/**/*

dependencies:
- libs/**/*

repo:
- .github/**/*
- *
5 changes: 5 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
branches:
- master
paths:
- "src/**"
- "Doxyfile"
- "README.md"
- ".github/workflows/build-docs.yml"

workflow_dispatch:

Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ name: Build Project

on:
pull_request:
branches: "*"
types:
- labeled
- synchronize
paths:
- "src/**"
- "CMakeLists.txt"
- ".github/workflows/build.yml"
push:
branches: "*"
branches: "master"
paths:
- "src/**"
- "CMakeLists.txt"
- ".github/workflows/build.yml"
workflow_dispatch:

jobs:
Expand All @@ -16,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install
- name: Install
run: |
sudo apt update
sudo apt install libxerces-c-dev -y
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/check-submission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check Submissions

on:
push:
branches:
- presentations

workflow_dispatch:

jobs:
check-submission:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Checkout 'presentations' branch
run: git checkout presentations

# Check for all sheet[num] folders if they contain a submission folder
# Each submission folder should contain atleast a `GroupC_Assignment[num].pdf` and `README.md` file
- name: Check Submissions
run: |
for i in $(find . -type d -name "sheet*"); do
if [ -d "$i/submission" ]; then
if [ ! $(find $i/submission -type f -name "README.md" | wc -l) -eq 1 ]; then
echo "Missing README.md in $i/submission"
exit 1
fi
if [ ! $(find $i/submission -type f -name "GroupC_Assignment*.pdf" | wc -l) -eq 1 ]; then
echo "Missing GroupC_Assignment*.pdf in $i/submission"
exit 1
fi
fi
done
15 changes: 14 additions & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
name: clang-format Check
on: [push, pull_request]
on:
pull_request:
paths:
- "src/**"
- ".clang-format"
- ".github/workflows/build.yml"
push:
branches: "master"
paths:
- "src/**"
- ".clang-format"
- ".github/workflows/build.yml"
workflow_dispatch:

jobs:
formatting-check:
name: Formatting Check
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/pullrequest-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Pull Request Labeler
on: [pull_request_target]

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true

0 comments on commit 35d2a65

Please sign in to comment.