-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.64 KB
/
Copy pathpython-ci.yml
File metadata and controls
60 lines (49 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Python CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test basic functionality
run: |
python -c "import os; print('Python import test passed')"
python -c "import hashlib; print('Hashlib import test passed')"
python -c "import shutil; print('Shutil import test passed')"
- name: Test script syntax
run: |
python -m py_compile run_cleanup.py
echo "Script syntax is valid"
- name: Run basic test
run: |
# Create test directories
mkdir -p test_source test_target
echo "Test file content" > test_source/test1.txt
echo "Test file content" > test_source/test2.txt
# Run the cleanup script
python run_cleanup.py test_source test_target <<< "n"
# Verify basic functionality
if [ -f test_target/清理报告_R1_MD5完全重复.md ]; then
echo "Basic test passed - Round 1 report generated"
else
echo "Basic test failed - Round 1 report not found"
exit 1
fi
- name: Clean up test files
run: |
rm -rf test_source test_target