From f3f2ae6b1cc073e10d51d1b8312a1348a0cc35b8 Mon Sep 17 00:00:00 2001 From: Michele Dolfi Date: Wed, 11 Dec 2024 09:38:53 +0100 Subject: [PATCH] ci: align workflows to docling Signed-off-by: Michele Dolfi --- .github/actions/setup-poetry/action.yml | 4 ++-- .github/mergify.yml | 16 ++++++++++++++++ .github/workflows/cd.yml | 6 ++---- .github/workflows/checks.yml | 2 +- .github/workflows/pypi.yml | 2 +- 5 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 .github/mergify.yml diff --git a/.github/actions/setup-poetry/action.yml b/.github/actions/setup-poetry/action.yml index e9ce697..853c517 100644 --- a/.github/actions/setup-poetry/action.yml +++ b/.github/actions/setup-poetry/action.yml @@ -8,9 +8,9 @@ runs: using: 'composite' steps: - name: Install poetry - run: pipx install poetry==1.8.3 + run: pipx install poetry==1.8.4 shell: bash - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} cache: 'poetry' diff --git a/.github/mergify.yml b/.github/mergify.yml new file mode 100644 index 0000000..713bd9e --- /dev/null +++ b/.github/mergify.yml @@ -0,0 +1,16 @@ +merge_protections: + - name: Enforce conventional commit + description: Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/ + if: + - base = main + success_conditions: + - "title ~= + ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\ + \\))?(!)?:" + - name: Require two reviewer for test updates + description: When test data is updated, we require two reviewers + if: + - base = main + - files ~= ^tests + success_conditions: + - "#approved-reviews-by >= 2" diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d10bf90..1f0502d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,9 +1,7 @@ name: "Run CD" on: - push: - branches: - - main + workflow_dispatch: env: # disable keyring (https://github.com/actions/runner-images/issues/6185): @@ -17,7 +15,7 @@ jobs: outputs: TARGET_TAG_V: ${{ steps.version_check.outputs.TRGT_VERSION }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # for fetching tags, required for semantic-release - uses: ./.github/actions/setup-poetry diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 33bbed3..bfeeb0d 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -8,7 +8,7 @@ jobs: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/actions/setup-poetry with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 0d206b2..395f34c 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -15,7 +15,7 @@ jobs: build-and-publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/actions/setup-poetry - name: Build and publish run: poetry publish --build --no-interaction --username=__token__ --password=${{ secrets.PYPI_TOKEN }}