diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1e4f5837..eb4caccc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,14 +1,13 @@ name: Build + on: - push: - branches: [ main, dev ] pull_request: - branches: [ main, dev ] + branches: [main, dev] workflow_dispatch: inputs: debug_enabled: type: boolean - description: Run the build with tmate debugging + description: Debug with tmate required: false default: false @@ -18,13 +17,13 @@ jobs: strategy: matrix: - python-version: [ "3.7", "3.8", "3.9", "3.10" ] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11.1"] steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Fetch complete history for all tags and branches + - name: Fetch all tags and branches run: git fetch --prune --unshallow - name: Create ArangoDB Docker container @@ -41,19 +40,19 @@ jobs: - name: Start ArangoDB Docker container run: docker start arango - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Start tmate session + - name: Debug with tmate uses: mxschmitt/action-tmate@v3 if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} - name: Run pre-commit checks uses: pre-commit/action@v3.0.0 - - name: Install package + - name: Install dependencies run: pip install .[dev] - name: Run unit tests @@ -67,7 +66,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 - if: matrix.python-version == '3.8' + if: matrix.python-version == '3.10' with: fail_ci_if_error: false token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index bafb67f6..23450ff4 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -1,9 +1,8 @@ name: CodeQL + on: - push: - branches: [ main, dev ] pull_request: - branches: [ main, dev ] + branches: [main, dev] schedule: - cron: '21 2 * * 3' @@ -11,12 +10,16 @@ jobs: analyze: name: Analyze runs-on: ubuntu-latest + + permissions: + security-events: write + steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: 'python' - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index db0985cd..3aec5ff8 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -1,31 +1,52 @@ name: Upload to PyPI + on: release: types: [published] + workflow_dispatch: + inputs: + debug_enabled: + type: boolean + description: Debug with tmate + required: false + default: false + jobs: upload: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v2 - - name: Fetch complete history for all tags and branches - run: git fetch --prune --unshallow - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine setuptools-scm[toml] - - name: Build distribution - run: python setup.py sdist bdist_wheel - - name: Publish to PyPI Test - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }} - run: twine upload --repository testpypi dist/* - - name: Publish to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: twine upload --repository pypi dist/* + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Fetch all tags and branches + run: git fetch --prune --unshallow + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Debug with tmate + uses: mxschmitt/action-tmate@v3 + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine setuptools-scm[toml] + + - name: Build distribution + run: python setup.py sdist bdist_wheel + + - name: Publish to PyPI Test + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }} + run: twine upload --repository testpypi dist/* + + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: twine upload --repository pypi dist/*