Merge pull request #340 from slaclab/pre-release #552
This file contains hidden or 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
# ---------------------------------------------------------------------------- | |
# Title : Ruckus GitHub Actions CI Script | |
# ---------------------------------------------------------------------------- | |
# This file is part of the 'Ruckus Package'. It is subject to | |
# the license terms in the LICENSE.txt file found in the top-level directory | |
# of this distribution and at: | |
# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. | |
# No part of the 'Ruckus Package', including this file, may be | |
# copied, modified, propagated, or distributed except according to the terms | |
# contained in the LICENSE.txt file. | |
# ---------------------------------------------------------------------------- | |
# The following environment variables are required for this process: | |
# secrets.GH_TOKEN | |
name: Ruckus Integration | |
on: [push] | |
jobs: | |
test_and_document: | |
name: Test And Generate Documentation | |
runs-on: ubuntu-24.04 | |
steps: | |
# This step checks out a copy of your repository. | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install doxygen doxygen-doc doxygen-latex doxygen-gui graphviz | |
python -m pip install --upgrade pip | |
pip install flake8 | |
- name: Check for trailing whitespace and tabs | |
run: | | |
# Check for trailing whitespace | |
if grep -rnI '[[:blank:]]$' --include=\*.{tcl,py,sh} .; then | |
echo "Error: Trailing whitespace found in the repository!" | |
exit 1 | |
fi | |
# Check for tab characters instead of spaces | |
if grep -rnI $'\t' --include=\*.{tcl,py,sh} .; then | |
echo "Error: Tab characters found in the repository! Please use spaces for indentation." | |
exit 1 | |
fi | |
- name: Python Syntax Check | |
run: | | |
python -m compileall -f scripts/ | |
flake8 --count scripts/ | |
- name: Generate Documentation | |
run: | | |
doxygen Doxyfile | |
- name: Deploy Documentation | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
publish_dir: html | |
# ---------------------------------------------------------------------------- | |
gen_release: | |
needs: [test_and_document] | |
uses: slaclab/ruckus/.github/workflows/gen_release.yml@main | |
with: | |
version: '1.0.0' | |
secrets: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
# ---------------------------------------------------------------------------- |