diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4e15e77201..48768af316 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,21 +48,6 @@ jobs: - name: Upload Coverage to Codecov uses: codecov/codecov-action@v3 - lib-check: - name: Check libraries - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Check libs - uses: canonical/charming-actions/check-libraries@2.4.0 - 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 @@ -101,7 +86,6 @@ jobs: free-disk-space: true name: ${{ matrix.tox-environments }} | ${{ matrix.agent-versions }} needs: - - lib-check - lint - unit-test - build diff --git a/.github/workflows/lib-check.yaml b/.github/workflows/lib-check.yaml new file mode 100644 index 0000000000..456d7cffa1 --- /dev/null +++ b/.github/workflows/lib-check.yaml @@ -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-operator' }} + steps: + - name: Checkout + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + with: + fetch-depth: 0 + - name: Check libs + uses: canonical/charming-actions/check-libraries@2.4.0 + with: + credentials: "${{ secrets.CHARMHUB_TOKEN }}" + github-token: "${{ secrets.GITHUB_TOKEN }}" + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fa2ec68708..83714e1cd4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,6 +13,7 @@ on: - poetry.lock - pyproject.toml - '.github/workflows/ci.yaml' + - '.github/workflows/lib-check.yaml' jobs: ci-tests: