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

[DPE-2804] Split off lib-check #298

Merged
merged 3 commits into from
Oct 24, 2023
Merged
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
16 changes: 0 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,6 @@ jobs:
- name: Run tests
run: tox run -e unit-${{ matrix.juju-version }}

lib-check:
name: Check libraries
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
fetch-depth: 0
- name: Check libs
uses: canonical/charming-actions/[email protected]
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"

build:
name: Build charms
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v2
Expand Down Expand Up @@ -93,7 +78,6 @@ jobs:
- "3.1.5" # renovate: latest juju 3
name: ${{ matrix.tox-environments }} | ${{ matrix.agent-versions }}
needs:
- lib-check
- lint
- unit-test
- build
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/lib-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
name: Check libs

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
paths-ignore:
- '.gitignore'
- '.jujuignore'
- 'LICENSE'
- '**.md'
- 'renovate.json'
schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
# Triggered on push to branch "main" by .github/workflows/release.yaml
workflow_call:

jobs:
lib-check:
name: Check libraries
runs-on: ubuntu-latest
timeout-minutes: 5
if: ${{ github.event.pull_request.head.repo.full_name == 'canonical/postgresql-k8s-operator' }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the PR is not from the main repo, skip the check.

steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
fetch-depth: 0
- name: Check libs
uses: canonical/charming-actions/[email protected]
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"

1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- pyproject.toml
- '.github/**.md'
- '.github/workflows/ci.yaml'
- '.github/workflows/lib-check.yaml'

jobs:
ci-tests:
Expand Down
6 changes: 3 additions & 3 deletions lib/charms/data_platform_libs/v0/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def restart(self, event) -> None:
import json
import logging
from abc import ABC, abstractmethod
from typing import List, Literal, Optional, Set, Tuple
from typing import Dict, List, Literal, Optional, Set, Tuple

import poetry.core.constraints.version as poetry_version
from ops.charm import (
Expand All @@ -285,7 +285,7 @@ def restart(self, event) -> None:

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 14
LIBPATCH = 15

PYDEPS = ["pydantic>=1.10,<2", "poetry-core"]

Expand Down Expand Up @@ -346,7 +346,7 @@ class KafkaDependenciesModel(BaseModel):
print(model.dict()) # exporting back validated deps
"""

dependencies: dict[str, str]
dependencies: Dict[str, str]
name: str
upgrade_supported: str
version: str
Expand Down