Skip to content

Changes for running and testing the roman_rubin catalog #222

Changes for running and testing the roman_rubin catalog

Changes for running and testing the roman_rubin catalog #222

Workflow file for this run

name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Get changed python files
id: changed_python_files
uses: tj-actions/changed-files@v20
with:
files: "*.py"
- name: Cache Python packages
if: steps.changed_python_files.outputs.any_changed == 'true'
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-py${{ matrix.python-version }}-pip-
- name: Set up Python ${{ matrix.python-version }}
if: steps.changed_python_files.outputs.any_changed == 'true'
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: steps.changed_python_files.outputs.any_changed == 'true'
run: |
python -m pip install --upgrade pip
pip install wheel
pip install .[full]
- name: Lint with flake8
if: steps.changed_python_files.outputs.any_changed == 'true'
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 ${{ steps.changed_python_files.outputs.all_changed_and_modified_files }} --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 ${{ steps.changed_python_files.outputs.all_changed_and_modified_files }} --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Lint with pylint
if: steps.changed_python_files.outputs.any_changed == 'true'
run: |
pip install pylint
pylint --disable=all --enable=F,E,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode --extension-pkg-whitelist=numpy ${{ steps.changed_python_files.outputs.all_changed_and_modified_files }}
- name: Test with pytest
if: steps.changed_python_files.outputs.any_changed == 'true'
run: |
pip install pytest
pytest