Skip to content

Commit

Permalink
Restructure workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbede committed Jan 19, 2024
1 parent 702970b commit 4847e33
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 14 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: "CodeQL"

# yamllint disable-line rule:truthy
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
schedule:
- cron: "30 1 * * 0"

jobs:
codeql:
name: Scanning
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🏗 Initialize CodeQL
uses: github/codeql-action/[email protected]
- name: 🚀 Perform CodeQL Analysis
uses: github/codeql-action/[email protected]
34 changes: 20 additions & 14 deletions .github/workflows/ci.yml → .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
name: CI
name: Linting

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

Expand All @@ -32,7 +30,7 @@ jobs:
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
run: poetry install --extras cli --no-interaction
- name: 🚀 Check code for common misspellings
run: poetry run pre-commit run codespell --all-files

Expand All @@ -55,7 +53,7 @@ jobs:
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
run: poetry install --extras cli --no-interaction
- name: 🚀 Run ruff linter
run: poetry run ruff check --output-format=github .
- name: 🚀 Run ruff formatter
Expand All @@ -80,7 +78,7 @@ jobs:
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
run: poetry install --extras cli --no-interaction
- name: 🚀 Check Python AST
run: poetry run pre-commit run check-ast --all-files
- name: 🚀 Check for case conflicts
Expand Down Expand Up @@ -127,7 +125,7 @@ jobs:
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
run: poetry install --extras cli --no-interaction
- name: 🚀 Run pylint
run: poetry run pre-commit run pylint --all-files

Expand All @@ -150,11 +148,12 @@ jobs:
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
run: poetry install --extras cli --no-interaction
- name: 🚀 Run yamllint
run: poetry run yamllint .
mypy:
name: mypy

prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
Expand All @@ -171,7 +170,14 @@ jobs:
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install dependencies
run: poetry install --no-interaction
- name: 🚀 Run mypy
run: poetry run mypy aiotankerkoenig
- name: 🏗 Install Python dependencies
run: poetry install --extras cli --no-interaction
- name: 🏗 Set up Node.js
uses: actions/[email protected]
with:
node-version-file: ".nvmrc"
cache: "npm"
- name: 🏗 Install NPM dependencies
run: npm install
- name: 🚀 Run prettier
run: poetry run pre-commit run prettier --all-files
35 changes: 35 additions & 0 deletions .github/workflows/typing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Typing

# yamllint disable-line rule:truthy
on:
push:
pull_request:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.11"

jobs:
mypy:
name: mypy
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install dependencies
run: poetry install --extras cli --no-interaction
- name: 🚀 Run mypy
run: poetry run mypy aiotankerkoenig

0 comments on commit 4847e33

Please sign in to comment.