From 28e6985b854062aa808ad0e5246a75c0f5df64fb Mon Sep 17 00:00:00 2001 From: anuttinck Date: Thu, 26 Sep 2024 10:33:54 +0200 Subject: [PATCH] [MOD] gha workflows by using gha repo [skip ci] Signed-off-by: anuttinck --- .github/workflows/branch-coverage-gha.yml | 36 ----------- .github/workflows/branch-coverage.yml | 39 ++++++------ .github/workflows/pull_request-gha.yml | 64 -------------------- .github/workflows/pull_request.yml | 74 ++++++++++------------- .github/workflows/tests-gha.yml | 27 --------- .github/workflows/tests.yml | 31 +++------- actions/buildout/action.yml | 26 -------- actions/coverage/action.yml | 24 -------- 8 files changed, 61 insertions(+), 260 deletions(-) delete mode 100644 .github/workflows/branch-coverage-gha.yml delete mode 100644 .github/workflows/pull_request-gha.yml delete mode 100644 .github/workflows/tests-gha.yml delete mode 100644 actions/buildout/action.yml delete mode 100644 actions/coverage/action.yml diff --git a/.github/workflows/branch-coverage-gha.yml b/.github/workflows/branch-coverage-gha.yml deleted file mode 100644 index 48ec82f1..00000000 --- a/.github/workflows/branch-coverage-gha.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Branch Coverage - -on: - workflow_dispatch: - -jobs: - coverage: - runs-on: gha-runners-delib-py3 - strategy: - fail-fast: false - matrix: - python-version: ["3.12"] - plone-version: ["6.0"] - steps: - - name: Run check - uses: IMIO/gha/plone-package-test-notify@v3 - env: - cache-name: cache-eggs - with: - PYTHON_VERSION: ${{ matrix.python-version }} - CACHE_KEY: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} - TEST_COMMAND: coverage run bin/test - REQUIREMENTS_FILE: 'requirements-tests.txt' - MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} - BUILDOUT_CONFIG_FILE: 'test-${{ matrix.plone-version }}.cfg' - - name: Report - run: | - coverage report - coverage xml - shell: bash - - name: Publish to Coveralls - run: | - coveralls --service=github - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/branch-coverage.yml b/.github/workflows/branch-coverage.yml index 0f009a4b..3ab05bc9 100644 --- a/.github/workflows/branch-coverage.yml +++ b/.github/workflows/branch-coverage.yml @@ -1,36 +1,37 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: Branch Coverage on: push: + workflow_dispatch: jobs: coverage: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 strategy: fail-fast: false matrix: python-version: ["3.12"] plone-version: ["6.0"] steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Cache eggs - uses: actions/cache@v2 + - name: Run check + uses: IMIO/gha/plone-package-test-notify@v3 env: cache-name: cache-eggs with: - path: ./buildout-cache/eggs - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} - - name: Buildout action - uses: IMIO/plonemeeting.portal.core/actions/buildout/@master - with: - py-version: ${{ matrix.python-version }} - plone-version: ${{ matrix.plone-version }} - - name: Coverage action - uses: IMIO/plonemeeting.portal.core/actions/coverage/@master - with: + PYTHON_VERSION: ${{ matrix.python-version }} + CACHE_KEY: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} + TEST_COMMAND: coverage run bin/test + REQUIREMENTS_FILE: 'requirements-tests.txt' + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + BUILDOUT_CONFIG_FILE: 'test-${{ matrix.plone-version }}.cfg' + - name: Report + run: | + coverage report + coverage xml + shell: bash + - name: Publish to Coveralls + run: | + coveralls --service=github + shell: bash + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull_request-gha.yml b/.github/workflows/pull_request-gha.yml deleted file mode 100644 index d395adcd..00000000 --- a/.github/workflows/pull_request-gha.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Pull Request - -on: - workflow_dispatch: - -jobs: - test: - runs-on: gha-runners-delib-py3 - continue-on-error: ${{ matrix.experimental }} - strategy: - fail-fast: false - matrix: - python-version: ["3.12"] - plone-version: ["6.0"] - experimental: [false] - steps: - - name: Run tests - uses: IMIO/gha/plone-package-test-notify@v3 - env: - cache-name: cache-eggs - with: - PYTHON_VERSION: ${{ matrix.python-version }} - CACHE_KEY: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} - TEST_COMMAND: bin/test - REQUIREMENTS_FILE: 'requirements-tests.txt' - MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} - BUILDOUT_CONFIG_FILE: 'test-${{ matrix.plone-version }}.cfg' - coverage: - runs-on: gha-runners-delib-py3 - strategy: - fail-fast: false - matrix: - python-version: ["3.12"] - plone-version: ["6.0"] - experimental: [false] - steps: - - name: Run coverage - uses: IMIO/gha/plone-package-test-notify@main - env: - cache-name: cache-eggs - with: - PYTHON_VERSION: ${{ matrix.python-version }} - CACHE_KEY: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} - TEST_COMMAND: coverage run bin/test - REQUIREMENTS_FILE: 'requirements-tests.txt' - MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} - BUILDOUT_CONFIG_FILE: 'test-${{ matrix.plone-version }}.cfg' - - name: Report - run: | - coverage report - coverage xml - shell: bash - - name: Publish to Coveralls - run: | - coveralls --service=github - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Cobertura - uses: 5monkeys/cobertura-action@v9 - with: - path: coverage.xml - repo_token: ${{ secrets.GITHUB_TOKEN }} - minimum_coverage: 90 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2486f736..4be7cdb8 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,14 +1,12 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: Pull Request on: pull_request: + workflow_dispatch: jobs: test: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false @@ -17,30 +15,19 @@ jobs: plone-version: ["6.0"] experimental: [false] steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Cache eggs - uses: actions/cache@v2 - env: - cache-name: cache-eggs - with: - path: ./buildout-cache/eggs - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }}-${{ matrix.plone-version }}-${{ hashFiles('setup.*') }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }}-${{ matrix.plone-version }} - - name: Buildout action - uses: IMIO/plonemeeting.portal.core/actions/buildout/@master - with: - py-version: ${{ matrix.python-version }} - plone-version: ${{ matrix.plone-version }} -# - name: code analysis -# run: | -# pre-commit run --all-files - - name: Test - run: | - bin/test - + - name: Run tests + uses: IMIO/gha/plone-package-test-notify@v3 + env: + cache-name: cache-eggs + with: + PYTHON_VERSION: ${{ matrix.python-version }} + CACHE_KEY: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} + TEST_COMMAND: bin/test + REQUIREMENTS_FILE: 'requirements-tests.txt' + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + BUILDOUT_CONFIG_FILE: 'test-${{ matrix.plone-version }}.cfg' coverage: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 strategy: fail-fast: false matrix: @@ -48,24 +35,27 @@ jobs: plone-version: ["6.0"] experimental: [false] steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Cache eggs - uses: actions/cache@v2 + - name: Run coverage + uses: IMIO/gha/plone-package-test-notify@main env: cache-name: cache-eggs with: - path: ./buildout-cache/eggs - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} - - name: Buildout action - uses: IMIO/plonemeeting.portal.core/actions/buildout/@master - with: - py-version: ${{ matrix.python-version }} - plone-version: ${{ matrix.plone-version }} - - name: Coverage action - uses: IMIO/plonemeeting.portal.core/actions/coverage/@master - with: + PYTHON_VERSION: ${{ matrix.python-version }} + CACHE_KEY: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} + TEST_COMMAND: coverage run bin/test + REQUIREMENTS_FILE: 'requirements-tests.txt' + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + BUILDOUT_CONFIG_FILE: 'test-${{ matrix.plone-version }}.cfg' + - name: Report + run: | + coverage report + coverage xml + shell: bash + - name: Publish to Coveralls + run: | + coveralls --service=github + shell: bash + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Cobertura uses: 5monkeys/cobertura-action@v9 diff --git a/.github/workflows/tests-gha.yml b/.github/workflows/tests-gha.yml deleted file mode 100644 index e5e77f85..00000000 --- a/.github/workflows/tests-gha.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Test package - -on: - workflow_dispatch: - -jobs: - test: - runs-on: gha-runners-delib-py3 - continue-on-error: ${{ matrix.experimental }} - strategy: - fail-fast: false - matrix: - python-version: ["3.12"] - plone-version: ["6.0"] - experimental: [false] - steps: - - name: Run tests - uses: IMIO/gha/plone-package-test-notify@v3 - env: - cache-name: cache-eggs - with: - PYTHON_VERSION: ${{ matrix.python-version }} - CACHE_KEY: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} - TEST_COMMAND: bin/test - REQUIREMENTS_FILE: 'requirements-tests.txt' - MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} - BUILDOUT_CONFIG_FILE: 'test-${{ matrix.plone-version }}.cfg' \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2a229d88..36af55ec 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,3 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: Test package on: @@ -9,7 +6,7 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: gha-runners-delib-py3 continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false @@ -18,24 +15,14 @@ jobs: plone-version: ["6.0"] experimental: [false] steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Cache eggs - uses: actions/cache@v2 + - name: Run tests + uses: IMIO/gha/plone-package-test-notify@v3 env: cache-name: cache-eggs with: - path: ./buildout-cache/eggs - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }}-${{ matrix.plone-version }} }} - restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }}-${{ matrix.plone-version }} - - name: Buildout action - uses: IMIO/plonemeeting.portal.core/actions/buildout@master - with: - py-version: ${{ matrix.python-version }} - plone-version: ${{ matrix.plone-version }} -# - name: code analysis -# run: | -# pre-commit run --all-files - - name: Test - run: | - bin/test + PYTHON_VERSION: ${{ matrix.python-version }} + CACHE_KEY: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.python-version }} + TEST_COMMAND: bin/test + REQUIREMENTS_FILE: 'requirements-tests.txt' + MATTERMOST_WEBHOOK_URL: ${{ secrets.DELIB_MATTERMOST_WEBHOOK_URL }} + BUILDOUT_CONFIG_FILE: 'test-${{ matrix.plone-version }}.cfg' \ No newline at end of file diff --git a/actions/buildout/action.yml b/actions/buildout/action.yml deleted file mode 100644 index e1495e68..00000000 --- a/actions/buildout/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: 'Buildout' -description: 'Buildout using a given python version' -inputs: - py-version: - description: 'python version' - required: true - default: '3.8' - plone-version: - description: 'Plone version' - required: true -runs: - using: "composite" - steps: - - name: Set up Python ${{ inputs.py-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ inputs.py-version }} - - name: Install dependencies - run: | - pip install -U pip setuptools coveralls coverage mockito pre-commit - pip install -r https://raw.githubusercontent.com/IMIO/buildout.pm.portal/master/requirements.txt - shell: bash - - name: buildout - run: | - buildout -c test-${{ inputs.plone-version }}.cfg buildout:download-cache=./buildout-cache/downloads buildout:eggs-directory=./buildout-cache/eggs - shell: bash diff --git a/actions/coverage/action.yml b/actions/coverage/action.yml deleted file mode 100644 index aeb8eed7..00000000 --- a/actions/coverage/action.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: 'Coverage' -description: 'Computes and publish coverage to coveralls' -inputs: - GITHUB_TOKEN: - description: 'GITHUB_TOKEN' - required: true -runs: - using: "composite" - steps: - - name: Test - run: | - coverage run bin/test - shell: bash - - name: Report - run: | - coverage report - coverage xml - shell: bash - - name: Publish to Coveralls - run: | - coveralls --service=github - shell: bash - env: - GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}