Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analysis #61

Closed
wants to merge 1 commit into from
Closed
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
46 changes: 46 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Analysis

on:
workflow_call:
inputs:
types:
description: "Enable type check"
required: false
type: boolean
default: true

jobs:
analyse:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install and configure poetry
uses: snok/install-poetry@v1
- name: Load cached venv
id: analysis
uses: actions/cache@v4
with:
path: ~/.cache
key: >-
${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}
-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --no-root --with-analysis
if: steps.cache.outputs.cache-hit != 'true'
- name: Install task runner
run: pip install poethepoet
- name: Lint
run: |
poe lint
poe lint-warnings
- name: Type check
if: ${{ inputs.types }}
run: |
poe mypy
17 changes: 6 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rules
name: Test

on:
workflow_call:
Expand Down Expand Up @@ -26,22 +26,22 @@ on:
required: false

jobs:
build:
test:
runs-on: ${{ inputs.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install and configure poetry
uses: snok/install-poetry@v1
- name: Load cached venv
id: rules
uses: actions/cache@v3
id: test
uses: actions/cache@v4
with:
path: ~/.cache
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand All @@ -52,11 +52,6 @@ jobs:
run: poetry install --no-interaction ${{ inputs.poetry-extras }}
- name: Install task runner
run: pip install poethepoet
- name: Lint
run: |
source $VENV
poe lint
poe lint-warnings
- name: Test
run: |
source $VENV
Expand Down