diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..da0bba3 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -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/checkout@v4.1.1 + - name: ๐Ÿ— Initialize CodeQL + uses: github/codeql-action/init@v3.23.1 + - name: ๐Ÿš€ Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3.23.1 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/linting.yml similarity index 88% rename from .github/workflows/ci.yml rename to .github/workflows/linting.yml index 82a3081..f06e558 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/linting.yml @@ -1,11 +1,9 @@ --- -name: CI +name: Linting # yamllint disable-line rule:truthy on: push: - branches: - - main pull_request: workflow_dispatch: @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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/setup-node@v4.0.1 + 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 \ No newline at end of file diff --git a/.github/workflows/typing.yml b/.github/workflows/typing.yml new file mode 100644 index 0000000..f4445af --- /dev/null +++ b/.github/workflows/typing.yml @@ -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/checkout@v4.1.1 + - name: ๐Ÿ— Set up Poetry + run: pipx install poetry + - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v5.0.0 + 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 \ No newline at end of file