From 350ae15e57eeb6fd034eea987fc423a3f42ed913 Mon Sep 17 00:00:00 2001 From: Daniel Perrefort Date: Mon, 2 Oct 2023 14:51:05 -0400 Subject: [PATCH] Updates CI --- .github/dependabot.yml | 8 ++++++++ .github/workflows/CodeQL.yml | 28 +++++++++++++--------------- .github/workflows/PackagePublish.yml | 12 ++++++------ .github/workflows/PackageTest.yml | 12 +++++++----- 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4ed6b07..c423fae 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,9 +5,17 @@ updates: schedule: interval: "monthly" open-pull-requests-limit: 100 + groups: + python-dependencies: + patterns: + - "*" - package-ecosystem: "github-actions" directory: "/" schedule: interval: "monthly" open-pull-requests-limit: 100 + groups: + actions-dependencies: + patterns: + - "*" diff --git a/.github/workflows/CodeQL.yml b/.github/workflows/CodeQL.yml index 427d49d..b46e0a7 100644 --- a/.github/workflows/CodeQL.yml +++ b/.github/workflows/CodeQL.yml @@ -6,7 +6,7 @@ on: pull_request: branches: [ main ] schedule: - - cron: 0 0 1 * * + - cron: 0 7 1 * * jobs: analyze: @@ -23,20 +23,18 @@ jobs: language: [ python ] steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: /language:${{matrix.language}} - + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: /language:${{matrix.language}} # Use this job for branch protection rules report-codeql-status: diff --git a/.github/workflows/PackagePublish.yml b/.github/workflows/PackagePublish.yml index eed9ba3..7bb6460 100644 --- a/.github/workflows/PackagePublish.yml +++ b/.github/workflows/PackagePublish.yml @@ -31,6 +31,9 @@ jobs: environment: publish-pypi steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v4 with: @@ -41,15 +44,12 @@ jobs: with: virtualenvs-create: false - - name: Checkout source - uses: actions/checkout@v4 - # Get the new package version from the release tag - # Release tags are expected to start with "refs/tags/v", so the first 11 characters are stripped + # Git release tags are expected to start with "refs/tags/v" - name: Set package version run: | release_tag=${{github.ref}} - poetry version "${release_tag:11}" + poetry version "${release_tag#refs/tags/v}" - name: Build package run: poetry build -v @@ -57,7 +57,7 @@ jobs: - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 with: - verbose: true + print-hash: true repository-url: ${{ matrix.host }} user: ${{ secrets.REPO_USER }} password: ${{ secrets.REPO_PASSWORD }} diff --git a/.github/workflows/PackageTest.yml b/.github/workflows/PackageTest.yml index 99eadc3..973a58b 100644 --- a/.github/workflows/PackageTest.yml +++ b/.github/workflows/PackageTest.yml @@ -4,6 +4,8 @@ on: workflow_dispatch: workflow_call: push: + schedule: + - cron: 0 7 1,15 * * jobs: run-tests: @@ -23,17 +25,17 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install poetry - run: | - pip install poetry - poetry env use python${{ matrix.python-version }} + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: false - name: Install dependencies run: poetry install --with tests - name: Run tests with coverage run: | - poetry run coverage run -m unittest discover tests + poetry run coverage run -m unittest discover poetry run coverage report --omit="tests/*" poetry run coverage xml --omit="tests/*" -o coverage.xml