Skip to content

Commit

Permalink
Merge pull request #231 from LSSTDESC/u/yymao/update-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
yymao authored May 19, 2022
2 parents 0940e02 + b384365 commit d6f4de1
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8]
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache Python packages
uses: actions/cache@v2
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 }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install gfortran # required by camb
Expand All @@ -37,17 +37,24 @@ jobs:
python -m pip install --upgrade pip
pip install wheel
pip install .[full]
- name: Get changed python files
id: changed_python_files
uses: tj-actions/changed-files@v20
with:
files: "*.py"
- 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 descqa descqagen descqaweb descqarun tests --count --select=E9,F63,F7,F82 --show-source --statistics
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 descqa descqagen descqaweb descqarun tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
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 descqa descqagen descqaweb descqarun
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
run: |
pip install pytest
Expand Down

0 comments on commit d6f4de1

Please sign in to comment.