Skip to content

Commit

Permalink
Updates CI (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
djperrefort authored Oct 2, 2023
1 parent e1584f6 commit f457aed
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 26 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- "*"
28 changes: 13 additions & 15 deletions .github/workflows/CodeQL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: [ main ]
schedule:
- cron: 0 0 1 * *
- cron: 0 7 1 * *

jobs:
analyze:
Expand All @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/PackagePublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -41,23 +44,20 @@ 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

- 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 }}
12 changes: 7 additions & 5 deletions .github/workflows/PackageTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
workflow_dispatch:
workflow_call:
push:
schedule:
- cron: 0 7 1,15 * *

jobs:
run-tests:
Expand All @@ -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
Expand Down

0 comments on commit f457aed

Please sign in to comment.