t8code indentation check #4901
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: 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 | |