-
Notifications
You must be signed in to change notification settings - Fork 53
78 lines (72 loc) · 2.91 KB
/
check_indentation.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: t8code indentation check
# This file is part of t8code.
# t8code is a C library to manage a collection (a forest) of multiple
# connected adaptive space-trees of general element types in parallel.
#
# Copyright (C) 2015 the developers
#
# t8code is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# t8code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with t8code; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# This github CI script checks whether all code files in the t8code
# repository are indented according to the indentation conventions.
# It is triggered for pull requests into main and develop and will also run once a day
# on main.
#
# The script runs the scripts/check_if_all_files_indented.scp script of t8code.
# The output is uploaded as an artifact to the github page.
on:
push:
branches:
- main
- develop
- feature-*CI* # for testing this script, all feature branches with "CI" in their name
pull_request:
branches:
- main
- develop
workflow_dispatch: # Be able to trigger this manually on github.com
# Run every night at 1:05
schedule:
- cron: '05 1 * * *'
jobs:
indent:
if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') || (github.event_name != 'schedule')
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true # required to get version tags
fetch-depth: 0 # required to get all history, especially the version tags
# Deactivated the install sudo because it failed.
#- name: install sudo
# run: apt update && apt install sudo
# On the github Ubuntu 20.04, sudo is not available by default
# we need it, however, to update/upgrade our packages.
- name: Update packages
run: sudo apt-get update && sudo apt-get upgrade -y
# This step is necessary to get the newest package data
- name: Install indent
run: pip install clang-format==17.0.1
- name: Indentation check
run: cd scripts/ && ./check_if_all_files_indented.scp &> >(tee -a indent_script_output.txt)
- name: Archive script output
# Do this regardess of the result of the previous step.
# We especially want to upload the result when the check fails.
if: always()
uses: actions/upload-artifact@v4
with:
name: t8code indentation report
path: scripts/indent_script_output.txt