Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: flake8

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main

jobs:
flake-8:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

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

- name: Cache pip
uses: actions/cache@v3
with:
# this path is specific to Ubuntu
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install flake8

- name: Install pyro
run: python setup.py install --user

- name: Run flake8
run: flake8 .
45 changes: 45 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: pylint

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main

jobs:
pylint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

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

- name: Cache pip
uses: actions/cache@v3
with:
# this path is specific to Ubuntu
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies + pylint
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pylint

- name: Install pyro
run: python setup.py install --user

- name: Validate
run: pylint --errors-only pyro.py ./advection ./advection_fv4 ./advection_nonuniform ./advection_rk ./advection_weno ./analysis ./compressible ./compressible_fv4 ./compressible_react ./compressible_rk ./compressible_sdc ./compressible_sr ./diffusion ./incompressible ./lm_atm ./mesh ./multigrid ./particles ./swe ./util

Original file line number Diff line number Diff line change
Expand Up @@ -11,54 +11,23 @@ on:
- main

jobs:
flake-8:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Cache pip
uses: actions/cache@v2
with:
# this path is specific to Ubuntu
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install pynucastro
run: python setup.py install --user

- name: Run flake8
run: flake8 .

pytest:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v3
with:
# this path is specific to Ubuntu
path: ~/.cache/pip
Expand All @@ -71,7 +40,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install pynucastro
- name: Install pyro
run: python setup.py install --user

- name: Run tests with pytest
Expand Down
Loading