Skip to content

Commit

Permalink
Pin ubuntu 20.04 on actions and split jobs into separate files (#33)
Browse files Browse the repository at this point in the history
* pin ubuntu 20.04 on actions

* split GHA into individual jobs

Co-authored-by: sseraj <sseraj@umich.edu>
  • Loading branch information
ewu63 and sseraj committed Apr 25, 2022
1 parent f32fb3d commit f299854
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 142 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
workflow_call:
inputs:
black_version:
required: false
type: string
default: "22.3.0"

jobs:
black:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
with:
options: "--check --diff -l 120 --target-version py38 --target-version py39"
version: ${{ inputs.black_version }}
13 changes: 13 additions & 0 deletions .github/workflows/clang_format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
on:
workflow_call:

jobs:
clang_format:
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: |
sudo apt-get install clang-format-10 -y
- name: Run clang_format
run: |
bash ./.github/clang_format.sh
34 changes: 34 additions & 0 deletions .github/workflows/flake8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
workflow_call:

jobs:
flake8:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install wheel
wget https://raw.githubusercontent.com/mdolab/.github/main/flake8-requirements.txt
pip install -r flake8-requirements.txt
- name: Lint with flake8
run: |
if [[ -f ".flake8" ]]; then
export FL8=.flake8-project
mv .flake8 $FL8; # rename the file from code repo; should have higher precedence in merge
fi
wget https://raw.githubusercontent.com/mdolab/.github/main/.flake8;
if [[ -f "$FL8" ]]; then
flake8 . --append-config $FL8 --count --show-source --statistics;
else
flake8 . --count --show-source --statistics;
fi
58 changes: 0 additions & 58 deletions .github/workflows/format.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/isort.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
workflow_call:

jobs:
isort:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Get isort config file
run: |
# copy over the isort config file
if [[ ! -f ".isort.cfg" ]]; then
wget https://raw.githubusercontent.com/mdolab/.github/main/.isort.cfg
fi
- uses: isort/isort-action@master
84 changes: 0 additions & 84 deletions .github/workflows/lint.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
workflow_call:

jobs:
mypy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install wheel
pip install mypy
- name: Mypy check
run: |
mypy --any-exprs-report mypy-output .
cat mypy-output/any-exprs.txt
21 changes: 21 additions & 0 deletions .github/workflows/pylint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
workflow_call:

jobs:
pylint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install wheel
pip install pylint
- name: Run pylint
run: |
# copy over the pylint config file
wget https://raw.githubusercontent.com/mdolab/.github/main/.pylintrc
find . -type f -name "*.py" -not -path "*/doc/*" | xargs pylint

0 comments on commit f299854

Please sign in to comment.