ci: switch to python3 for all checks
This commit is contained in:
@@ -16,36 +16,24 @@ jobs:
|
|||||||
git clone --depth 1 --branch "${GITHUB_REF_NAME}" \
|
git clone --depth 1 --branch "${GITHUB_REF_NAME}" \
|
||||||
"https://oauth2:${{ github.token }}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
|
"https://oauth2:${{ github.token }}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
|
||||||
|
|
||||||
- name: Python 2 syntax check
|
- name: Python syntax check
|
||||||
run: |
|
run: |
|
||||||
echo "Checking Python 2 syntax..."
|
echo "Checking Python syntax..."
|
||||||
failed=0
|
failed=0
|
||||||
for f in ppf.py proxywatchd.py scraper.py httpd.py \
|
for f in *.py; do
|
||||||
config.py dbs.py fetch.py connection_pool.py \
|
if python3 -m py_compile "$f" 2>&1; then
|
||||||
engines.py translations.py http2.py \
|
echo "OK $f"
|
||||||
mysqlite.py misc.py comboparse.py soup_parser.py; do
|
else
|
||||||
if [ -f "$f" ]; then
|
echo "FAIL $f"
|
||||||
if python2 -m py_compile "$f" 2>/dev/null; then
|
failed=1
|
||||||
echo "OK $f"
|
|
||||||
else
|
|
||||||
echo "FAIL $f"
|
|
||||||
failed=1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
exit $failed
|
exit $failed
|
||||||
|
|
||||||
- name: Python 3 syntax check
|
|
||||||
run: |
|
|
||||||
echo "Checking Python 3 syntax..."
|
|
||||||
for f in *.py; do
|
|
||||||
python3 -m py_compile "$f" 2>/dev/null && echo "OK $f" || echo "WARN $f"
|
|
||||||
done
|
|
||||||
|
|
||||||
memory-leak-check:
|
memory-leak-check:
|
||||||
runs-on: dotfiles
|
runs-on: dotfiles
|
||||||
container:
|
container:
|
||||||
image: python:2.7-slim
|
image: python:3-slim
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
run: |
|
||||||
@@ -53,10 +41,6 @@ jobs:
|
|||||||
git clone --depth 1 --branch "${GITHUB_REF_NAME}" \
|
git clone --depth 1 --branch "${GITHUB_REF_NAME}" \
|
||||||
"https://oauth2:${{ github.token }}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
|
"https://oauth2:${{ github.token }}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" .
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
pip install --quiet objgraph || true
|
|
||||||
|
|
||||||
- name: Check for memory leak patterns
|
- name: Check for memory leak patterns
|
||||||
run: |
|
run: |
|
||||||
echo "Scanning for common memory leak patterns..."
|
echo "Scanning for common memory leak patterns..."
|
||||||
@@ -109,7 +93,7 @@ jobs:
|
|||||||
- name: Static import check
|
- name: Static import check
|
||||||
run: |
|
run: |
|
||||||
echo "Verifying imports..."
|
echo "Verifying imports..."
|
||||||
cd . && python2 -c "import sys; sys.path.insert(0,'.'); import config; print('OK config')" || echo "FAIL config"
|
python3 -c "import sys; sys.path.insert(0,'.'); import config; print('OK config')" || echo "FAIL config"
|
||||||
cd . && python2 -c "import sys; sys.path.insert(0,'.'); import misc; print('OK misc')" || echo "FAIL misc"
|
python3 -c "import sys; sys.path.insert(0,'.'); import misc; print('OK misc')" || echo "FAIL misc"
|
||||||
cd . && python2 -c "import sys; sys.path.insert(0,'.'); import mysqlite; print('OK mysqlite')" || echo "FAIL mysqlite"
|
python3 -c "import sys; sys.path.insert(0,'.'); import mysqlite; print('OK mysqlite')" || echo "FAIL mysqlite"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user