-
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.
- Loading branch information
0 parents
commit 268e213
Showing
42 changed files
with
4,156 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,5 @@ | ||
--ignore-dir=.venv | ||
--ignore-dir=bin | ||
--ignore-dir=htmlcov | ||
--ignore-dir=log | ||
--ignore-dir=test/acceptance/cassettes |
Validating CODEOWNERS rules …
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 @@ | ||
* @github/vuln-mgmt-eng |
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,51 @@ | ||
--- | ||
version: 2 | ||
registries: | ||
ghcr: # Define access for a private registry | ||
type: docker-registry | ||
url: ghcr.io | ||
username: PAT | ||
password: ${{secrets.CONTAINER_BUILDER_TOKEN}} | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "sunday" | ||
time: "21:00" | ||
commit-message: | ||
prefix: "[actions] " | ||
include: "scope" | ||
groups: | ||
dev-dependencies: | ||
patterns: | ||
- "*" # A wildcard that matches all dependencies in the package | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
registries: | ||
- ghcr # Allow version updates for dependencies in this registry | ||
schedule: | ||
interval: "weekly" | ||
day: "sunday" | ||
time: "21:00" | ||
commit-message: | ||
prefix: "[docker] " | ||
include: "scope" | ||
groups: | ||
dev-dependencies: | ||
patterns: | ||
- "*" # A wildcard that matches all dependencies in the package | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "sunday" | ||
time: "21:00" | ||
commit-message: | ||
prefix: "[pip] " | ||
prefix-development: "[pip][dev] " | ||
include: "scope" | ||
groups: | ||
dev-dependencies: | ||
patterns: | ||
- "*" # A wildcard that matches all dependencies in the package |
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,51 @@ | ||
name: ship-package | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-upload: | ||
runs-on: self-hosted | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check for Changed Files | ||
id: changed-files | ||
uses: tj-actions/changed-files@635f118699dd888d737c15018cd30aff2e0274f8 | ||
with: | ||
files: | | ||
annotated_logger | ||
Dockerfile | ||
pyproject.toml | ||
requirements.txt | ||
- name: Log into registry | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_USER }} | ||
password: ${{ secrets.GHCR_PW }} | ||
|
||
- name: Build Package | ||
uses: ./ # Action defined in action.yaml in the root | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
|
||
- name: Setup Octofactory config | ||
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
env: | ||
JF_ENV_1: ${{ secrets.OCTOFACTORY_SERVER_CONFIG }} | ||
|
||
- name: Upload to Octofactory | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
run: | | ||
jfrog rt u dist/ logger-decorator-pypi |
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,38 @@ | ||
name: Mutation Testing | ||
|
||
on: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
checks: write | ||
|
||
jobs: | ||
mutation-testing: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install hatch | ||
hatch env create dev | ||
- name: Run mutation testing | ||
run: | | ||
set -e | ||
# Run pytest to get coverage so that mutmut can skip non covered lines | ||
hatch run dev:pytest | ||
hatch run dev:mutmut run --CI --no-progress | ||
hatch run dev:mutmut results | ||
hatch run dev:mutmut junitxml > junit.xml | ||
- name: Parse Results | ||
uses: mikepenz/action-junit-report@v4 | ||
if: always() | ||
with: | ||
report_paths: junit.xml | ||
fail_on_failure: true | ||
require_passed_tests: true |
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,37 @@ | ||
name: package-quality-control | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# Checks that version number has been updated | ||
package-quality-control: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Current PR Branch | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- name: Check for Changed Files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files: | | ||
pyproject.toml | ||
annotated_logger/__init__.py | ||
- name: Install hatch | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
run: python -m pip install hatch | ||
- name: Compare Versions | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
run: | | ||
export BRANCH_VERSION=$(hatch version) | ||
git checkout main | ||
export MAIN_VERSION=$(hatch version) | ||
if [[ "$BRANCH_VERSION" == "$MAIN_VERSION" ]]; then echo "Please update package version number." && exit 1; fi |
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,22 @@ | ||
name: Pyright | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
pyright: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install hatch | ||
hatch env create dev | ||
- run: echo "$(hatch env find dev)/bin" >> $GITHUB_PATH | ||
- name: Run pyright | ||
uses: jakebailey/[email protected] |
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,71 @@ | ||
name: Pytest | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [ main ] | ||
|
||
|
||
jobs: | ||
pytest: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.9", "3.10", "3.11", "pypy3.9", "pypy3.10"] | ||
exclude: | ||
- os: macos-latest | ||
python-version: "3.9" | ||
- os: windows-latest | ||
python-version: "3.9" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install hatch | ||
hatch env create dev | ||
- name: Test with pytest | ||
run: | | ||
# Need relative files for the action to report, but it messes up mutmut | ||
echo "[run]" >> .coveragerc | ||
echo "relative_files = true" >> .coveragerc | ||
cat .coveragerc | ||
hatch run dev:pytest | ||
env: | ||
COVERAGE_FILE: ".coverage.${{ matrix.os }}.${{ matrix.python-version }}" | ||
- name: Store coverage file | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-${{ matrix.os }}-${{ matrix.python-version }} | ||
path: .coverage.${{ matrix.os }}.${{ matrix.python-version }} | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
needs: pytest | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/download-artifact@v4 | ||
id: download | ||
with: | ||
pattern: coverage-* | ||
merge-multiple: true | ||
- name: Re-add relative so the action is happy | ||
run: | | ||
echo "[run]" >> .coveragerc | ||
echo "relative_files = true" >> .coveragerc | ||
- name: Python Coverage Comment | ||
uses: py-cov-action/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
MERGE_COVERAGE_FILES: true |
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,22 @@ | ||
name: Ruff | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
ruff: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install hatch | ||
hatch env create dev | ||
- name: Lint with Ruff | ||
run: | | ||
hatch run dev:ruff --output-format=github . |
Oops, something went wrong.