Skip to content

Commit

Permalink
feat: update lint to not install dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
armand-sauzay committed Feb 24, 2024
1 parent 3ebbdb1 commit 482f947
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 68 deletions.
18 changes: 0 additions & 18 deletions .github/renovate.json

This file was deleted.

9 changes: 4 additions & 5 deletions .github/workflows/update-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: Renovate
on:
schedule:
- cron: "0 0 * * *"
- cron: "0 * * * *"
workflow_dispatch:

jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4
- name: Self-hosted Renovate
uses: renovatebot/github-action@v36.0.0
uses: renovatebot/github-action@v40.1.0
env:
RENOVATE_REPOSITORIES: ${{ github.repository }}
RENOVATE_ONBOARDING: false
with:
configurationFile: .github/renovate.json
token: ${{ secrets.RENOVATE_TOKEN }}
# token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0 # Use the ref you want to point at
rev: v4.1.0
hooks:
- id: check-json
- id: check-yaml
Expand All @@ -12,7 +12,7 @@ repos:
- id: prettier
stages: [commit]
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.4.0
rev: v9.11.0
hooks:
- id: commitlint
stages: [commit-msg]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
This project is forked from open-turo/actions-python
</b>
<p align="center">
GitHub Action for `python` based repositories. It uses `pip` as package manager.
GitHub Action for `python` based repositories. It supports `pip` and `poetry` as package manager.
</p>
</p>

Expand Down
25 changes: 3 additions & 22 deletions lint/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ inputs:
python-version:
required: false
description: Python version to install on the github runner.
default: ""
default: "3.12"

runs:
using: composite
Expand All @@ -26,30 +26,11 @@ runs:
if: inputs.checkout-repo == 'true'
with:
fetch-depth: 0
- name: Install poetry
if: hashFiles('pyproject.toml') != ''
shell: bash
run: pipx install poetry
- name: Setup python
# this will use by default the .python-version of your repo
if: hashFiles('poetry.lock') != ''
uses: actions/setup-python@v4
with:
cache: "poetry"
python-version: ${{ inputs.python-version }}
- name: Setup python
# this will use by default the .python-version of your repo
if: hashFiles('poetry.lock') == ''
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Install poetry dependencies
if: hashFiles('pyproject.toml') != ''
shell: bash
run: |
poetry install
- name: Install pip dependencies
if: hashFiles('pyproject.toml') == ''
shell: bash
run: pip install -e .
- uses: pre-commit/[email protected]
with:
extra_args: ${{ inputs.extra-args }}
4 changes: 4 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", ":enablePreCommit"]
}
30 changes: 10 additions & 20 deletions test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,37 @@ runs:
uses: actions/checkout@v3
with:
fetch-depth: 0

# If we do have a poetry.lock, we use a poetry based workflow
# See README.md for more information on what is supported
- name: Install poetry
if: hashFiles('poetry.lock') != ''
shell: bash
run: pipx install poetry
- name: Setup python
# this will use by default the .python-version of your repo
if: hashFiles('poetry.lock') != ''
uses: actions/setup-python@v4
with:
cache: "poetry"
python-version: ${{ inputs.python-version }}
- run: poetry install
shell: bash
- run: poetry run pytest
shell: bash

# If we don't have a poetry.lock, we use a pip based workflow
- name: Setup python
# this will use by default the .python-version of your repo
if: hashFiles('poetry.lock') == ''
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: "pip"
- name: Install pip dependencies
if: hashFiles('poetry.lock') == ''
shell: bash
run: |
# Install the current package as editable
pip install -e .
# Install the extras="dev" setup.py dependencies
pip install -e ".[dev]" || true
# Install the extras="test" setup.py dependencies
pip install -e ".[test]" || true
pip install -r requirements.txt
- name: Run pip tests
if: hashFiles('poetry.lock') == ''
shell: bash
run: pytest ${{ inputs.test-flags }}
- name: Install poetry dependencies
if: hashFiles('poetry.lock') != ''
shell: bash
run: |
poetry install --extras dev || echo "No dev extras"
poetry install --with dev || echo "No dev dependency group"
poetry install --extras test || echo "No test extras"
poetry install --with test || echo "No test dependency group"
- name: Run poetry tests
if: hashFiles('poetry.lock') != ''
shell: bash
run: poetry run pytest ${{ inputs.test-flags }}

0 comments on commit 482f947

Please sign in to comment.