diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..94d110b33 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,37 @@ +name: "CodeQL" +on: + workflow_dispatch: + #push: + # branches: [master] + #pull_request: + # branches: [master] + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ["python"] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + queries: security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 906c93b05..000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Docs - -# If a pull-request is pushed then cancel all previously running jobs related -# to that pull-request -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -on: - push: - branches: - - main - pull_request: - branches: - - main - - master - -env: - PY_COLORS: 1 - -jobs: - sphinx: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.0 - - name: Set up Python - uses: actions/setup-python@v4.5.0 - with: - python-version: "3.11" - - name: Install dependencies - run: pip install tox - - name: Build docs - env: - TOXENV: docs - run: tox - - name: Archive generated docs - uses: actions/upload-artifact@v3.1.2 - with: - name: html-docs - path: build/sphinx/html/ - - twine-check: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.0 - - name: Set up Python - uses: actions/setup-python@v4.5.0 - with: - python-version: "3.11" - - name: Install dependencies - run: pip install tox twine wheel - - name: Check twine readme rendering - env: - TOXENV: twine-check - run: tox diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 8c03b2326..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Lint - -# If a pull-request is pushed then cancel all previously running jobs related -# to that pull-request -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -on: - push: - branches: - - main - pull_request: - branches: - - main - - master - -env: - PY_COLORS: 1 - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.0 - with: - fetch-depth: 0 - - uses: actions/setup-python@v4.5.0 - with: - python-version: "3.11" - - run: pip install --upgrade tox - - name: Run commitizen (https://commitizen-tools.github.io/commitizen/) - run: tox -e cz - - name: Run black code formatter (https://black.readthedocs.io/en/stable/) - run: tox -e black -- --check - - name: Run flake8 (https://flake8.pycqa.org/en/latest/) - run: tox -e flake8 - - name: Run mypy static typing checker (http://mypy-lang.org/) - run: tox -e mypy - - name: Run isort import order checker (https://pycqa.github.io/isort/) - run: tox -e isort -- --check - - name: Run pylint Python code static checker (https://github.com/PyCQA/pylint) - run: tox -e pylint diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index 202f439f5..000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'Lock Closed Issues' - -on: - schedule: - - cron: '0 0 * * 1 ' - workflow_dispatch: # For manual cleanup - -permissions: - issues: write - -concurrency: - group: lock - -jobs: - action: - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@v4.0.0 - with: - process-only: 'issues' diff --git a/.github/workflows/pre_commit.yml b/.github/workflows/pre_commit.yml deleted file mode 100644 index c546f83e9..000000000 --- a/.github/workflows/pre_commit.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: pre_commit - -# If a pull-request is pushed then cancel all previously running jobs related -# to that pull-request -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -on: - push: - branches: - - main - paths: - .github/workflows/pre_commit.yml - .pre-commit-config.yaml - pull_request: - branches: - - main - - master - paths: - - .github/workflows/pre_commit.yml - - .pre-commit-config.yaml - -env: - PY_COLORS: 1 - -jobs: - - pre_commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.0 - - uses: actions/setup-python@v4.5.0 - with: - python-version: "3.11" - - name: install tox - run: pip install tox==3.26.0 - - name: pre-commit - run: tox -e pre-commit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d4aa82160..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release - -on: - schedule: - - cron: '0 0 28 * *' # Monthly auto-release - workflow_dispatch: # Manual trigger for quick fixes - -jobs: - release: - if: github.repository == 'python-gitlab/python-gitlab' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.5.0 - with: - fetch-depth: 0 - token: ${{ secrets.RELEASE_GITHUB_TOKEN }} - - name: Python Semantic Release - uses: relekang/python-semantic-release@v7.33.2 - with: - github_token: ${{ secrets.RELEASE_GITHUB_TOKEN }} - pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/rerun-test.yml b/.github/workflows/rerun-test.yml deleted file mode 100644 index 1c88d2eff..000000000 --- a/.github/workflows/rerun-test.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: 'Rerun failed workflows' - -on: - issue_comment: - types: [created] - -jobs: - rerun_pr_tests: - name: rerun_pr_tests - if: ${{ github.event.issue.pull_request }} - runs-on: ubuntu-20.04 - steps: - - uses: estroz/rerun-actions@main - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - comment_id: ${{ github.event.comment.id }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index dd0ecf98a..000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,40 +0,0 @@ -# https://github.com/actions/stale -name: 'Close stale issues and PRs' -on: - schedule: - - cron: '30 1 * * *' - -permissions: - issues: write - pull-requests: write - -concurrency: - group: lock - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v8.0.0 - with: - any-of-labels: 'need info,Waiting for response' - stale-issue-message: > - This issue was marked stale because it has been open 60 days with no - activity. Please remove the stale label or comment on this issue. Otherwise, - it will be closed in 15 days. - days-before-issue-stale: 60 - days-before-issue-close: 15 - close-issue-message: > - This issue was closed because it has been marked stale for 15 days with no - activity. If this issue is still valid, please re-open. - - stale-pr-message: > - This Pull Request (PR) was marked stale because it has been open 90 days - with no activity. Please remove the stale label or comment on this PR. - Otherwise, it will be closed in 15 days. - days-before-pr-stale: 90 - days-before-pr-close: 15 - close-pr-message: > - This PR was closed because it has been marked stale for 15 days with no - activity. If this PR is still valid, please re-open. - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index a09afc508..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: Test - -# If a pull-request is pushed then cancel all previously running jobs related -# to that pull-request -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -on: - push: - branches: - - main - pull_request: - branches: - - main - - master - -env: - PY_COLORS: 1 - -jobs: - unit: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: - - version: "3.7" - toxenv: py37,smoke - - version: "3.8" - toxenv: py38,smoke - - version: "3.9" - toxenv: py39,smoke - - version: "3.10" - toxenv: py310,smoke - - version: "3.11" - toxenv: py311,smoke - - version: '3.12.0-alpha - 3.12' # SemVer's version range syntax - toxenv: py312,smoke - include: - - os: macos-latest - python: - version: "3.11" - toxenv: py310,smoke - - os: windows-latest - python: - version: "3.11" - toxenv: py310,smoke - steps: - - uses: actions/checkout@v3.5.0 - - name: Set up Python ${{ matrix.python.version }} - uses: actions/setup-python@v4.5.0 - with: - python-version: ${{ matrix.python.version }} - - name: Install dependencies - run: pip install tox - - name: Run tests - env: - TOXENV: ${{ matrix.python.toxenv }} - run: tox --skip-missing-interpreters false - - functional: - runs-on: ubuntu-20.04 - strategy: - matrix: - toxenv: [api_func_v4, cli_func_v4] - steps: - - uses: actions/checkout@v3.5.0 - - name: Set up Python - uses: actions/setup-python@v4.5.0 - with: - python-version: "3.11" - - name: Install dependencies - run: pip install tox - - name: Run tests - env: - TOXENV: ${{ matrix.toxenv }} - run: tox -- --override-ini='log_cli=True' - - name: Upload codecov coverage - uses: codecov/codecov-action@v3.1.1 - with: - files: ./coverage.xml - flags: ${{ matrix.toxenv }} - fail_ci_if_error: false - - coverage: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3.5.0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4.5.0 - with: - python-version: "3.11" - - name: Install dependencies - run: pip install tox - - name: Run tests - env: - PY_COLORS: 1 - TOXENV: cover - run: tox - - name: Upload codecov coverage - uses: codecov/codecov-action@v3.1.1 - with: - files: ./coverage.xml - flags: unit - fail_ci_if_error: false - - dist: - runs-on: ubuntu-latest - name: Python wheel - steps: - - uses: actions/checkout@v1.2.0 - - uses: actions/setup-python@v2.3.3 - with: - python-version: "3.11" - - name: Install dependencies - run: | - pip install -r requirements-test.txt - - name: Build package - run: python -m build -o dist/ - - uses: actions/upload-artifact@v2.3.1 - with: - name: dist - path: dist - - test: - runs-on: ubuntu-latest - needs: [dist] - steps: - - uses: actions/checkout@v3.5.0 - - name: Set up Python - uses: actions/setup-python@v4.5.0 - with: - python-version: '3.11' - - uses: actions/download-artifact@v3.0.2 - with: - name: dist - path: dist - - name: install dist/*.whl and requirements - run: pip install dist/*.whl -r requirements-test.txt tox - - name: Run tests - run: tox -e install