Skip to content

Commit 962dcb9

Browse files
committed
fixed CI/CD
1 parent f92cfab commit 962dcb9

11 files changed

Lines changed: 3132 additions & 25 deletions

.github/workflows/ci.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ jobs:
1313
test-cli:
1414
name: Test CLI Functionality
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 30
1617

1718
strategy:
1819
matrix:
19-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
20+
python-version: ["3.9", "3.10", "3.11", "3.12"]
2021

2122
steps:
2223
- name: Checkout code
@@ -28,7 +29,7 @@ jobs:
2829
python-version: ${{ matrix.python-version }}
2930

3031
- name: Cache pip dependencies
31-
uses: actions/cache@v3
32+
uses: actions/cache@v4
3233
with:
3334
path: ~/.cache/pip
3435
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
@@ -58,17 +59,18 @@ jobs:
5859
5960
- name: Run tests
6061
run: |
61-
pytest tests/ -v --cov=pygetpapers --cov-report=xml --cov-report=term-missing
62+
pytest tests/ -v --cov=pygetpapers --cov-report=xml --cov-report=term-missing --timeout=300
6263
6364
- name: Upload coverage to Codecov
64-
uses: codecov/codecov-action@v3
65+
uses: codecov/codecov-action@v4
6566
with:
6667
file: ./coverage.xml
6768
fail_ci_if_error: false
6869

6970
test-streamlit:
7071
name: Test Streamlit UI
7172
runs-on: ubuntu-latest
73+
timeout-minutes: 20
7274

7375
steps:
7476
- name: Checkout code
@@ -80,7 +82,7 @@ jobs:
8082
python-version: ${{ env.PYTHON_VERSION }}
8183

8284
- name: Cache pip dependencies
83-
uses: actions/cache@v3
85+
uses: actions/cache@v4
8486
with:
8587
path: ~/.cache/pip
8688
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-streamlit-${{ hashFiles('**/requirements.txt') }}
@@ -116,6 +118,7 @@ jobs:
116118
name: Build Package
117119
runs-on: ubuntu-latest
118120
needs: [test-cli, test-streamlit]
121+
timeout-minutes: 15
119122

120123
steps:
121124
- name: Checkout code
@@ -136,7 +139,7 @@ jobs:
136139
python -m build
137140
138141
- name: Upload build artifacts
139-
uses: actions/upload-artifact@v3
142+
uses: actions/upload-artifact@v4
140143
with:
141144
name: dist-files
142145
path: dist/
@@ -146,6 +149,7 @@ jobs:
146149
runs-on: ubuntu-latest
147150
needs: [test-cli, test-streamlit]
148151
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v20'
152+
timeout-minutes: 15
149153

150154
steps:
151155
- name: Checkout code
@@ -168,7 +172,7 @@ jobs:
168172
mkdir -p docs/_build
169173
170174
# Copy Streamlit documentation to docs
171-
cp README_STREAMLIT.md docs/
175+
cp README_STREAMLIT.md docs/ || echo "README_STREAMLIT.md not found"
172176
cp -r docs/* docs/_build/ || echo "No existing docs to copy"
173177
174178
- name: Deploy to GitHub Pages
@@ -181,6 +185,7 @@ jobs:
181185
security-scan:
182186
name: Security Scan
183187
runs-on: ubuntu-latest
188+
timeout-minutes: 15
184189

185190
steps:
186191
- name: Checkout code
@@ -205,7 +210,7 @@ jobs:
205210
safety check --json --output safety-report.json || true
206211
207212
- name: Upload security reports
208-
uses: actions/upload-artifact@v3
213+
uses: actions/upload-artifact@v4
209214
with:
210215
name: security-reports
211216
path: |

.github/workflows/streamlit-dev.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
test-streamlit-ui:
1111
name: Test Streamlit UI Components
1212
runs-on: ubuntu-latest
13+
timeout-minutes: 20
1314

1415
steps:
1516
- name: Checkout code
@@ -21,7 +22,7 @@ jobs:
2122
python-version: "3.9"
2223

2324
- name: Cache pip dependencies
24-
uses: actions/cache@v3
25+
uses: actions/cache@v4
2526
with:
2627
path: ~/.cache/pip
2728
key: ${{ runner.os }}-pip-streamlit-${{ hashFiles('**/requirements.txt') }}
@@ -90,6 +91,7 @@ jobs:
9091
name: Build Streamlit Documentation
9192
runs-on: ubuntu-latest
9293
if: github.ref == 'refs/heads/v20'
94+
timeout-minutes: 15
9395

9496
steps:
9597
- name: Checkout code
@@ -120,12 +122,12 @@ jobs:
120122
echo "</ul></body></html>" >> docs/_build/html/index.html
121123
122124
# Copy markdown files for reference
123-
cp README_STREAMLIT.md docs/_build/html/
124-
cp docs/user-guide.md docs/_build/html/
125-
cp docs/streamlit-ui-implementation.md docs/_build/html/
125+
cp README_STREAMLIT.md docs/_build/html/ || echo "README_STREAMLIT.md not found"
126+
cp docs/user-guide.md docs/_build/html/ || echo "user-guide.md not found"
127+
cp docs/streamlit-ui-implementation.md docs/_build/html/ || echo "streamlit-ui-implementation.md not found"
126128
127129
- name: Upload documentation artifacts
128-
uses: actions/upload-artifact@v3
130+
uses: actions/upload-artifact@v4
129131
with:
130132
name: streamlit-docs
131133
path: docs/_build/html/

0 commit comments

Comments
 (0)