Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Updates CI
Browse files Browse the repository at this point in the history
  • Loading branch information
djperrefort committed Oct 2, 2023
1 parent 5472596 commit 580e27f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 44 deletions.
8 changes: 2 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ updates:
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 10
groups:
python-dependencies:
patterns:
- "*"
open-pull-requests-limit: 100

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 10
open-pull-requests-limit: 100
groups:
actions-dependencies:
patterns:
Expand Down
23 changes: 11 additions & 12 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: 25 5 * * 0
- cron: 0 7 1 * *

jobs:
analyze:
Expand All @@ -23,16 +23,15 @@ jobs:
language: [ python ]

steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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: 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: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: /language:${{matrix.language}}
53 changes: 27 additions & 26 deletions .github/workflows/PackageTest.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Tests
name: Test Package

on:
workflow_dispatch:
workflow_call:
push:
schedule:
- cron: 0 7 1,15 * *

jobs:
run-tests:
Expand All @@ -12,10 +14,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]

steps:
- name: Set up Python ${{ matrix.python-version }}
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -25,45 +30,41 @@ jobs:
with:
virtualenvs-create: false

- name: Checkout source
uses: actions/checkout@v3

- name: Install package dependencies
- name: Install dependencies
run: poetry install --with tests

- name: Run tests with coverage
run: |
coverage run -m unittest discover
coverage report --omit="tests/*"
coverage xml --omit="tests/*" -o report_${{ matrix.python-version }}.xml
poetry run coverage run -m unittest discover
poetry run coverage report --omit="tests/*"
poetry run coverage xml --omit="tests/*" -o coverage.xml
# Report test coverage to codacy for the python version being tested
# Report partial coverage results to codacy for the current python version
- name: Report partial coverage results
if: github.event_name != 'release'
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial -l Python -r report_${{ matrix.python-version }}.xml
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial -l Python -r coverage.xml
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

# Use this job for branch protection rules
report-test-status:
name: Report Test Status
runs-on: ubuntu-latest
needs: run-tests
if: always()
steps:
- name: Check build status
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

# Tell codacy we are done reporting test coverage
report-code-coverage:
name: Report Coverage
runs-on: ubuntu-latest
needs: run-tests
if: github.event_name != 'release'
needs: run-tests
runs-on: ubuntu-latest
steps:
- name: Finish reporting coverage
shell: bash
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) final
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

# Use this job for branch protection rules
report-test-status:
name: Report Test Status
if: always()
needs: run-tests
runs-on: ubuntu-latest
steps:
- name: Check build status
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

0 comments on commit 580e27f

Please sign in to comment.