Fix ci
This commit is contained in:
parent
030860c0a1
commit
790305bc07
|
|
@ -1,47 +1,39 @@
|
||||||
name: Pull Request Action
|
name: Regression Testing
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
push:
|
||||||
|
branches: [ master, feature/tox ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
getchange:
|
regression-testing:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
outputs:
|
|
||||||
matrix: ${{ steps.changes.outputs.matrix }}
|
|
||||||
steps:
|
|
||||||
- id: changes
|
|
||||||
run: |
|
|
||||||
URL="https://api.github.com/repos/sherlock-project/sherlock/pulls/${{ github.event.pull_request.number }}/files"
|
|
||||||
FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename')
|
|
||||||
if echo $FILES | grep -q ".json"; then
|
|
||||||
echo "::set-output name=matrix::{\"include\":[{\"python\":\"3.x\"}]}"
|
|
||||||
else
|
|
||||||
echo "::set-output name=matrix::{\"include\":[{\"python\":\"3.7\"},{\"python\":\"3.8\"}]},{\"python\":\"3.9\"},{\"python\":\"3.10\"}]},{\"python\":\"3.11\"},{\"python\":\"3.12\"}]}"
|
|
||||||
fi
|
|
||||||
tests:
|
|
||||||
needs: [getchange]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix: ${{ fromJson(needs.getchange.outputs.matrix) }}
|
matrix:
|
||||||
|
os: [
|
||||||
|
ubuntu-latest,
|
||||||
|
windows-latest,
|
||||||
|
]
|
||||||
|
python-version: [
|
||||||
|
'3.8',
|
||||||
|
'3.9',
|
||||||
|
'3.10',
|
||||||
|
'3.11',
|
||||||
|
'3.12',
|
||||||
|
'3.13',
|
||||||
|
]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Python ${{ matrix.python }}
|
- name: Set up environment ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install Dependencies
|
- name: Install tox and related dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install ruff flake8 pytest
|
pip install tox
|
||||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
pip install tox-gh-actions
|
||||||
- name: Lint With Ruff
|
- name: Run tox
|
||||||
run: |
|
run: tox
|
||||||
# stop the build if there are Python syntax errors or undefined names
|
|
||||||
ruff check . --output-format=github --select=E9,F63,F7,F82
|
|
||||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
||||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
||||||
- name: Sherlock Site Detect Tests
|
|
||||||
run: |
|
|
||||||
cd sherlock && python -m unittest tests.all.SherlockDetectTests --verbose
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue