Skip to content

Commit

Permalink
Fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ppfeister committed May 20, 2024
1 parent 08c321d commit 53ba35a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 45 deletions.
68 changes: 30 additions & 38 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,39 @@
name: Pull Request Action
name: Regression Testing

on:
pull_request:
branches: [ master ]
push:
branches: [ master, feature/tox ]

jobs:
getchange:
runs-on: ubuntu-latest
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
regression-testing:
runs-on: ${{ matrix.os }}
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:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install ruff flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint With Ruff
run: |
# 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
- uses: actions/checkout@v4
- name: Set up environment ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox and related dependencies
run: |
python -m pip install --upgrade pip
pip install tox
pip install tox-gh-actions
- name: Run tox
run: tox
14 changes: 7 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ deps =
commands =
ruff check

[gh]
[gh-actions]
python =
3.13 = py31
3.12 = py312
3.11 = py311
3.10 = py310
3.9 = py39
3.8 = py38
3.13: py31
3.12: py312
3.11: py311
3.10: py310
3.9: py39
3.8: py38

0 comments on commit 53ba35a

Please sign in to comment.