mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-06-29 21:10:57 +00:00
74 lines
2 KiB
YAML
74 lines
2 KiB
YAML
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 30
|
|
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
python-version: "pypy-2.7"
|
|
- os: macos-latest
|
|
python-version: "3.8"
|
|
- os: windows-latest
|
|
python-version: "3.14"
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Python sanity
|
|
run: python -VV
|
|
|
|
- name: Pyflakes lint
|
|
shell: bash
|
|
run: |
|
|
set +e
|
|
python -m pip install pyflakes
|
|
python -c "
|
|
import subprocess, sys
|
|
files = subprocess.check_output(['git', 'ls-files', '*.py']).decode().splitlines()
|
|
files = [f for f in files if not f.startswith('thirdparty/')]
|
|
p = subprocess.Popen([sys.executable, '-m', 'pyflakes'] + files, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
|
out, _ = p.communicate()
|
|
lines = [l for l in out.decode().splitlines() if ' redefines ' not in l]
|
|
if lines:
|
|
print('\n'.join(lines))
|
|
sys.exit(1)
|
|
print('pyflakes: clean')
|
|
"
|
|
|
|
- name: Basic import test
|
|
run: python -c "import sqlmap; import sqlmapapi"
|
|
|
|
- name: Unit tests
|
|
# -B: do not write .pyc files. On Python 2 / PyPy a cached .pyc makes a module's __file__
|
|
# point at the .pyc, which would make the later --smoke getFileType(__file__) doctest see
|
|
# 'binary' instead of 'text'. Keeping this step byte-compile-free leaves --smoke clean.
|
|
run: python -B -m unittest discover -s tests -p "test_*.py"
|
|
|
|
- name: Smoke test
|
|
run: python sqlmap.py --smoke-test
|
|
|
|
- name: Vuln test
|
|
run: python sqlmap.py --vuln-test
|
|
|
|
- name: API test
|
|
run: python sqlmap.py --api-test
|