-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: dependencies, code scanning, tests
- Loading branch information
1 parent
95e9167
commit a571487
Showing
5 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" # pyproject.toml | ||
schedule: | ||
interval: "daily" | ||
commit-message: | ||
prefix: "chore" | ||
include: "scope" | ||
labels: | ||
- "dependencies" | ||
- package-ecosystem: "github-actions" | ||
# Workflow files stored in the | ||
# default location of `.github/workflows` | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
commit-message: | ||
prefix: "chore" | ||
include: "scope" | ||
labels: | ||
- "dependencies" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# https://codeql.github.com/ | ||
name: CodeQL | ||
|
||
on: | ||
push: | ||
paths: | ||
- "**.py" | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- "**.py" | ||
schedule: | ||
- cron: "24 9 * * 6" | ||
|
||
jobs: | ||
setup: | ||
name: Set up CodeQL analysis | ||
runs-on: ubuntu-latest | ||
# Required permissions | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
# changes is a JSON array with names of all filters matching any of the changed files | ||
languages: ${{ steps.filter.outputs.changes }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
python: "**.py" | ||
codeql: | ||
name: CodeQL Analyze | ||
runs-on: ubuntu-latest | ||
needs: setup | ||
if: ${{ needs.setup.outputs.languages != '[]' }} | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Parse JSON array containing names of all filters matching any of changed files | ||
# e.g. ['javascript', 'python'] if both file types had changes | ||
language: ${{ fromJSON(needs.setup.outputs.languages) }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#specifying-configuration-details-using-the-config-input | ||
config: | | ||
paths-ignore: | ||
- tests | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: "Dependency PR triage" | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
dependency-triage: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
# see https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#responding-to-events | ||
if: github.actor == 'dependabot[bot]' || github.actor == 'pre-commit-ci[bot]' | ||
steps: | ||
- name: add-label | ||
uses: andymckay/labeler@master | ||
with: | ||
add-labels: "dependencies" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Pytest | ||
|
||
on: [push, pull_request, workflow_call] | ||
|
||
jobs: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# Gives the action the necessary permissions for publishing new | ||
# comments in pull requests. | ||
pull-requests: write | ||
# Gives the action the necessary permissions for pushing data to the | ||
# python-coverage-comment-action branch, and for editing existing | ||
# comments (to avoid publishing multiple comments in the same PR) | ||
contents: write | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: .github/workflows/.python-version | ||
cache: pip | ||
cache-dependency-path: "**/pyproject.toml" | ||
|
||
- name: Install Python dependencies | ||
run: pip install -e .[test] | ||
|
||
- name: Run tests | ||
run: ./tests/run.sh | ||
|
||
- name: Upload coverage report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-report | ||
path: tests/coverage | ||
|
||
- name: Coverage comment | ||
uses: py-cov-action/python-coverage-comment-action@v3 | ||
with: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
MINIMUM_GREEN: 90 | ||
MINIMUM_ORANGE: 80 |