Skip to content

Commit

Permalink
Add GitHub Actions workflow for linting code.
Browse files Browse the repository at this point in the history
  • Loading branch information
srogawski-nvidia authored Oct 15, 2024
1 parent 6079124 commit ca115b9
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,21 @@ jobs:
if [ -d "public" ]; then
echo "public directory exists. Proceeding with deployment."
find . -maxdepth 1 ! -name '.git' ! -name '.' ! -name 'public' -exec rm -rf {} +
cp -r public/* .
touch .nojekyll
ls -la .
touch .nojekyll
git add .
git commit -m "Deploy updated documentation to GitHub Pages from commit $GITHUB_SHA"
git push origin gh-pages --force
if git diff --cached --quiet; then
echo "No changes to commit. Skipping deployment."
exit 0
else
git commit -m "Deploy updated documentation to GitHub Pages from commit $GITHUB_SHA"
git push origin gh-pages --force
fi
else
echo "Error: 'public/' directory does not exist during deployment."
exit 1
fi
38 changes: 38 additions & 0 deletions .github/workflows/lint_code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint Code

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install linting dependencies
run: |
pip install black==24.10.0 isort==5.13.2 ruff==0.6.9
- name: Run Black
run: |
black --check .
- name: Run isort
run: |
isort --check-only .
- name: Run Ruff
run: |
ruff check .

0 comments on commit ca115b9

Please sign in to comment.