Skip to content

Commit

Permalink
chore: merge remote-tracking branch 'starbase/main' into work/update-…
Browse files Browse the repository at this point in the history
…starbase
  • Loading branch information
lengau committed Jul 17, 2024
2 parents 66b6bae + 76fac3f commit 81b8136
Show file tree
Hide file tree
Showing 12 changed files with 235 additions and 84 deletions.
7 changes: 1 addition & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 80
max_line_length = 88
trim_trailing_whitespace = true

[.editorconfig]
Expand All @@ -29,15 +29,10 @@ indent_size = 2
max_line_length = off

[{*.markdown,*.md,*.rst}]
max_line_length = off
ij_visual_guides = none

[{*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,poetry.lock}]
max_line_length = off

[{*.ini, *.cfg}]
max_line_length = off

[{*.yaml,*.yml}]
indent_size = 2
max_line_length = off
14 changes: 7 additions & 7 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
// Automerge patches, pin changes and digest changes.
// Also groups these changes together.
groupName: "bugfixes",
excludePackagePrefixes: ["lint", "types"],
excludeDepPatterns: ["lint/.*", "types/.*"],
matchUpdateTypes: ["patch", "pin", "digest"],
prPriority: 3, // Patches should go first!
automerge: true
},
{
// Update all internal packages in one higher-priority PR
groupName: "internal packages",
matchPackagePrefixes: ["craft-", "snap-"],
matchDepPatterns: ["craft-.*", "snap-.*"],
matchLanguages: ["python"],
prPriority: 2
},
Expand All @@ -59,10 +59,10 @@
// Minor changes can be grouped and automerged for dev dependencies, but are also deprioritised.
groupName: "development dependencies (non-major)",
groupSlug: "dev-dependencies",
matchPackagePrefixes: [
"dev",
"lint",
"types"
matchDepPatterns: [
"dev/.*",
"lint/.*",
"types/.*"
],
matchUpdateTypes: ["minor", "patch", "pin", "digest"],
prPriority: -1,
Expand All @@ -74,7 +74,7 @@
groupSlug: "doc-dependencies",
matchPackageNames: ["Sphinx", "furo"],
matchPackagePatterns: ["[Ss]phinx.*$"],
matchPackagePrefixes: ["docs"],
matchDepPatterns: ["docs/.*"],
},
{
// Other major dependencies get deprioritised below minor dev dependencies.
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/check-renovate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Renovate check
on:
pull_request:
paths:
- ".github/workflows/check-renovate.yaml"
- ".github/renovate.json5"

# Allows triggering the workflow manually from the Actions tab
workflow_dispatch:
inputs:
enable_ssh_access:
type: boolean
description: 'Enable ssh access'
required: false
default: false

jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install renovate
run: npm install --global renovate
- name: Enable ssh access
uses: mxschmitt/action-tmate@v3
if: ${{ inputs.enable_ssh_access }}
with:
limit-access-to-actor: true
- name: Check renovate config
run: renovate-config-validator .github/renovate.json5
- name: Renovate dry-run
run: renovate --dry-run --autodiscover
env:
RENOVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RENOVATE_USE_BASE_BRANCH_CONFIG: ${{ github.ref }}
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
sudo apt-get install -y libapt-pkg-dev
pip install tox
- name: Lint documentation
run: tox run -e lint-docs
run: tox run --colored yes -e lint-docs
- name: Build documentation
run: tox run -e build-docs
run: tox run --colored yes -e build-docs
- name: Upload documentation
uses: actions/upload-artifact@v4
with:
Expand Down
29 changes: 18 additions & 11 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
name: Tests, linting, etc.
name: test
on:
push:
branches:
- "main"
- "feature/*"
- "hotfix/*"
- "release/*"
- "renovate/*"
pull_request:

jobs:
linters:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: conventional commits
uses: webiny/[email protected]
with:
allowed-commit-types: "build,chore,ci,docs,feat,fix,perf,refactor,style,test"
- name: Setup Python
uses: actions/setup-python@v5
with:
Expand All @@ -26,7 +31,7 @@ jobs:
echo "::group::Begin snap install"
echo "Installing snaps in the background while running apt and pip..."
sudo snap install --no-wait --classic pyright
sudo snap install --no-wait ruff shellcheck
sudo snap install --no-wait codespell shellcheck ruff
echo "::endgroup::"
echo "::group::apt-get"
sudo apt update
Expand All @@ -36,7 +41,7 @@ jobs:
python -m pip install tox
echo "::endgroup::"
echo "::group::Create virtual environments for linting processes."
tox run -m lint --notest
tox run --colored yes -m lint --notest
echo "::endgroup::"
echo "::group::Wait for snap to complete"
snap watch --last=install
Expand All @@ -47,18 +52,19 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-22.04]
platform: [ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python versions on ${{ matrix.platform }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: |
3.10
3.12
3.13-dev
cache: 'pip'
- name: Setup LXD
uses: canonical/[email protected]
Expand All @@ -75,9 +81,9 @@ jobs:
echo "::endgroup::"
mkdir -p results
- name: Setup Tox environments
run: tox run -m unit-tests --notest
- name: Unit tests
run: .tox/.tox/bin/tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-${{ matrix.platform }}.json -m unit-tests
run: tox run --colored yes -m tests --notest
- name: Test with tox
run: tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-${{ matrix.platform }}.json --colored yes -m unit-tests
env:
PYTEST_ADDOPTS: "--no-header -vv -rN"
- name: Upload code coverage
Expand All @@ -95,19 +101,20 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-22.04]
platform: [ubuntu-22.04, ubuntu-24.04]
python: [py310, py312]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python versions on ${{ matrix.platform }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: |
3.10
3.12
3.13-dev
cache: 'pip'
- name: Setup LXD
uses: canonical/[email protected]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,6 @@ dmypy.json

# Ignore version module generated by setuptools_scm
/*/_version.py

# Visual Studio Code
.vscode/
13 changes: 5 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: "v4.4.0"
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -12,19 +12,16 @@ repos:
- id: check-toml
- id: fix-byte-order-marker
- id: mixed-line-ending
- repo: https://github.com/charliermarsh/ruff-pre-commit
# renovate: datasource=pypi;depName=ruff
rev: "v0.0.267"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.15"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
# renovate: datasource=pypi;depName=black
rev: "23.3.0"
rev: "24.1.1"
hooks:
- id: black
- repo: https://github.com/adrienverge/yamllint.git
# renovate: datasource=pypi;depName=yamllint
rev: "v1.31.0"
rev: "v1.33.0"
hooks:
- id: yamllint
Loading

0 comments on commit 81b8136

Please sign in to comment.