Skip to content

Commit

Permalink
chore: split github action ci jobs (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna authored Oct 4, 2023
1 parent 5e25d96 commit 10cdb80
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
name: CI - Lint and Test
name: CI

on: pull_request
on:
pull_request:

jobs:
lint:
name: Lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
arch: [x64]
os: [ubuntu-latest]
python-version: ["3.10.x"]
steps:
- name: Checkout
uses: actions/checkout@v2

uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}

- name: Set up poetry and upgrade pip
run: pip install -U pip poetry

- name: Install this package
run: poetry install

- name: Lint source code
run: poetry run lint

- name: Lint pull request title
uses: amannn/action-semantic-pull-request@v5
env:
Expand All @@ -40,6 +36,25 @@ jobs:
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
arch: [x64]
os: [ubuntu-latest]
python-version: ["3.10.x"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
- name: Set up poetry and upgrade pip
run: pip install -U pip poetry
- name: Install this package
run: poetry install
- name: Test
run: poetry run test
12 changes: 8 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@ repos:
args: [-b, main]
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/python-poetry/poetry
rev: 1.6.0
hooks:
- id: poetry-check
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.29.0
hooks:
- id: yamllint
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.0
hooks:
Expand Down
3 changes: 2 additions & 1 deletion scripts/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ def run(*args):
def main():
"""Lint all python files in the project"""
code = 0
code |= run(["poetry", "check"])
code |= run(["yamllint", "."])
code |= run(["isort", "--check-only", "."])
code |= run(["black", "--check", "."])
code |= run(["isort", "--check-only", "."])
code |= run(["autoflake", "--check", "--recursive", "--quiet", "."])
code |= run(["flake8", "."])
exit(code)

0 comments on commit 10cdb80

Please sign in to comment.