Python3.12 support #3424
Workflow file for this run
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '0 2 * * *' | |
permissions: | |
contents: read | |
jobs: | |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
release_test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ windows-latest ] | |
python-version: [ "3.12"] | |
# exclude: | |
# # exclude py3.12 for windows latest due UserWarning: Unsupported Windows version (2022server). ONNX Runtime supports Windows 10 and above, only. | |
# - os: windows-latest | |
# python-version: "3.12" | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Upgrade PIP | |
run: | | |
# windows requires update pip via python module | |
python -m pip install --upgrade pip | |
# - name: Patch onnxruntime warning | |
# if: ${{ matrix.python-version == '3.12' && matrix.os == 'windows-latest' }} | |
# run: | | |
# git apply github-windows-py3_12.patch | |
# type credsweeper/ml_model/ml_validator.py | |
- name: Install application | |
run: | | |
python -m pip install . | |
python -m pip freeze | |
- name: Remove sources dir to check installation | |
if: runner.os != 'Windows' | |
run: rm -rf credsweeper | |
- name: Remove sources dir to check installation WINDOWS PowerShell | |
if: runner.os == 'Windows' | |
run: Remove-Item -Path credsweeper -Force -Recurse | |
- name: CLI tool check | |
run: | | |
credsweeper --help | |
- name: Install test framework dependencies | |
run: | | |
pip install pytest pytest-random-order deepdiff | |
- name: Suppress warning Unsupported Windows version (2022server) | |
if: ${{ matrix.python-version == '3.12' && matrix.os == 'windows-latest' }} | |
run: | | |
echo "PYTHONWARNINGS=ignore::UserWarning" >> $env:GITHUB_ENV | |
- name: UnitTest with pytest | |
run: | | |
# put the command into one line to use in various OS to avoid processing differences in new line char sequence | |
echo $env:PYTHONWARNINGS | |
pytest --random-order --random-order-bucket=global tests/test_app.py | |
echo $env:PYTHONWARNINGS | |