From 59fc82bdb2a0e95b8d2d3474f78fe510e730be99 Mon Sep 17 00:00:00 2001 From: tison Date: Fri, 11 Nov 2022 08:22:16 +0800 Subject: [PATCH 1/4] tidy repo settings Signed-off-by: tison --- .asf.yaml | 26 +++---------------------- .github/workflows/ci-pr-validation.yaml | 3 --- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 766ceb6..d6d504d 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -28,43 +28,23 @@ github: - queuing - event-streaming features: - # Enable wiki for documentation - wiki: true - # Enable issues management + wiki: false issues: true - # Enable projects for project management boards projects: true enabled_merge_buttons: - # enable squash button: squash: true - # disable merge button: merge: false - # disable rebase button: rebase: false protected_branches: main: required_status_checks: - # # strict means "Require branches to be up to date before merging". - strict: false - # # Contexts are the names of checks that must pass. - # # See ./github/workflows/README.md for more documentation on this list. + # Contexts are the names of checks that must pass. + # See ./github/workflows/README.md for more documentation on this list. contexts: - Check Completion - required_pull_request_reviews: - dismiss_stale_reviews: false - require_code_owner_reviews: true required_approving_review_count: 1 - # squash or rebase must be allowed in the repo for this setting to be set to true. - required_linear_history: true - - required_signatures: false - - # The following branch protections only ensure that force pushes are not allowed - # branch-3.xxx: {} - - notifications: commits: commits@pulsar.apache.org issues: commits@pulsar.apache.org diff --git a/.github/workflows/ci-pr-validation.yaml b/.github/workflows/ci-pr-validation.yaml index 6f3f894..55d42d3 100644 --- a/.github/workflows/ci-pr-validation.yaml +++ b/.github/workflows/ci-pr-validation.yaml @@ -27,7 +27,6 @@ concurrency: cancel-in-progress: true jobs: - unit-tests: name: Run unit tests runs-on: ubuntu-22.04 @@ -237,8 +236,6 @@ jobs: ls -l *.dll python -c 'import pulsar; c = pulsar.Client("pulsar://localhost:6650"); c.close()' - - # Job that will be required to complete and depends on all the other jobs check-completion: name: Check Completion runs-on: ubuntu-latest From 2bdd86eefe4aca6124df71b4d82ea21968064ae6 Mon Sep 17 00:00:00 2001 From: tison Date: Fri, 11 Nov 2022 08:26:17 +0800 Subject: [PATCH 2/4] cancelled should not pass the require check Signed-off-by: tison --- .github/workflows/ci-pr-validation.yaml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-pr-validation.yaml b/.github/workflows/ci-pr-validation.yaml index 55d42d3..b927172 100644 --- a/.github/workflows/ci-pr-validation.yaml +++ b/.github/workflows/ci-pr-validation.yaml @@ -239,7 +239,21 @@ jobs: check-completion: name: Check Completion runs-on: ubuntu-latest - needs: [unit-tests, linux-wheel, mac-wheels, windows-wheels] - + if: ${{ always() }} + needs: [ + unit-tests, + linux-wheel, + mac-wheels, + windows-wheels + ] steps: - - run: true + - run: | + if [[ ! ( \ + "${{ needs.unit-tests.result }}" == "success" \ + && "${{ needs.linux-wheel.result }}" == "success" \ + && "${{ needs.mac-wheels.result }}" == "success" \ + && "${{ needs.windows-wheels.result }}" == "success" \ + ) ]]; then + echo "Required jobs haven't been completed successfully." + exit 1 + fi From 5fcc890b8088caa3490b1b5c66ad27e0ab68d7c2 Mon Sep 17 00:00:00 2001 From: tison Date: Fri, 11 Nov 2022 08:32:35 +0800 Subject: [PATCH 3/4] add check-and-lint job Signed-off-by: tison --- .github/workflows/ci-pr-validation.yaml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-pr-validation.yaml b/.github/workflows/ci-pr-validation.yaml index b927172..f4a5a31 100644 --- a/.github/workflows/ci-pr-validation.yaml +++ b/.github/workflows/ci-pr-validation.yaml @@ -27,6 +27,25 @@ concurrency: cancel-in-progress: true jobs: + check-and-lint: + name: Lint and check code + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - name: Install deps + run: pip install -U pydoctor + - name: Check docs syntax + run: | + pydoctor --make-html \ + --html-viewsource-base=https://github.com/apache/pulsar-client-python/tree/main \ + --docformat=numpy --theme=readthedocs \ + --intersphinx=https://docs.python.org/3/objects.inv \ + --html-output=apidocs \ + pulsar + unit-tests: name: Run unit tests runs-on: ubuntu-22.04 @@ -241,6 +260,7 @@ jobs: runs-on: ubuntu-latest if: ${{ always() }} needs: [ + check-and-lint, unit-tests, linux-wheel, mac-wheels, @@ -249,7 +269,8 @@ jobs: steps: - run: | if [[ ! ( \ - "${{ needs.unit-tests.result }}" == "success" \ + "${{ needs.check-and-lint.result }}" == "success" \ + && "${{ needs.unit-tests.result }}" == "success" \ && "${{ needs.linux-wheel.result }}" == "success" \ && "${{ needs.mac-wheels.result }}" == "success" \ && "${{ needs.windows-wheels.result }}" == "success" \ From 23f1d4feca8a6fab755d3ffb527876780d779114 Mon Sep 17 00:00:00 2001 From: tison Date: Fri, 11 Nov 2022 08:39:16 +0800 Subject: [PATCH 4/4] F yaml Signed-off-by: tison --- .github/workflows/ci-pr-validation.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-pr-validation.yaml b/.github/workflows/ci-pr-validation.yaml index f4a5a31..132ece7 100644 --- a/.github/workflows/ci-pr-validation.yaml +++ b/.github/workflows/ci-pr-validation.yaml @@ -268,13 +268,13 @@ jobs: ] steps: - run: | - if [[ ! ( \ - "${{ needs.check-and-lint.result }}" == "success" \ - && "${{ needs.unit-tests.result }}" == "success" \ - && "${{ needs.linux-wheel.result }}" == "success" \ - && "${{ needs.mac-wheels.result }}" == "success" \ - && "${{ needs.windows-wheels.result }}" == "success" \ - ) ]]; then - echo "Required jobs haven't been completed successfully." - exit 1 - fi + if [[ ! ( \ + "${{ needs.check-and-lint.result }}" == "success" \ + && "${{ needs.unit-tests.result }}" == "success" \ + && "${{ needs.linux-wheel.result }}" == "success" \ + && "${{ needs.mac-wheels.result }}" == "success" \ + && "${{ needs.windows-wheels.result }}" == "success" \ + ) ]]; then + echo "Required jobs haven't been completed successfully." + exit 1 + fi