Skip to content

Commit 9e03524

Browse files
Add CI workflow for Python scraper project
1 parent 5be85d2 commit 9e03524

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI for Python Scraper (Main)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-lint-test-scan:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Required for SonarCloud
18+
19+
- name: Set up Python 3.11
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.11
23+
24+
- name: Install dependencies
25+
run: pip install requests pytest ruff
26+
27+
- name: Lint with Ruff
28+
continue-on-error: true
29+
run: |
30+
ruff check . --ignore E402
31+
32+
- name: Test with Pytest
33+
continue-on-error: true
34+
run: |
35+
export PYTHONPATH=$PYTHONPATH:.
36+
pytest unit_test/
37+
38+
- name: SonarCloud Scan
39+
continue-on-error: true
40+
uses: SonarSource/sonarcloud-github-action@v2
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)