Dataset metrics #1430
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: Python | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
pylint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get Diff Action | |
uses: technote-space/get-diff-action@v6 | |
with: | |
PATTERNS: | | |
+(scripts|resources|bfasst)/**/*.py | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
if: env.GIT_DIFF | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r $(git ls-files 'requirements.txt') | |
pip install -e . | |
git submodule update --init third_party/WaFoVe | |
python -m pip install -e third_party/WaFoVe | |
cd third_party/WaFoVe && make build | |
if: env.GIT_DIFF | |
- name: Check for syntax errors with pylint | |
run: | | |
pylint --errors-only $(git ls-files --directory scripts --directory bfasst | grep -e ".py$") | |
if: env.GIT_DIFF | |
- name: Analysing the code with pylint | |
run: | | |
pylint ${{ env.GIT_DIFF_FILTERED }} | |
if: env.GIT_DIFF | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r $(git ls-files 'requirements.txt') | |
- name: Run format | |
run: | | |
make format | |
- name: Check for formatting errors | |
run: | | |
git diff --exit-code | |
if [ $? -eq 1 ]; then | |
echo "Formatting errors detected. Please run 'make format' and commit the changes." | |
exit 1 | |
fi | |
doctest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run doctest | |
run: | | |
make doctest | |