Skip to content

Commit fc8bd04

Browse files
chore: simplify CI workflows for uv-based project
- Remove obsolete pylint.yml and test.yml (referenced old structure) - Add ci.yml with simple lint + test jobs using uv - Update release.yml for root-level project - Update python-publish.yml for uv build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 22dbab5 commit fc8bd04

5 files changed

Lines changed: 58 additions & 239 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: astral-sh/setup-uv@v3
15+
- run: uv sync --frozen
16+
- run: uv run ruff check .
17+
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: astral-sh/setup-uv@v3
23+
- run: uv sync --frozen
24+
- run: uv run pytest tests/ -v --ignore=tests/test_integration.py

.github/workflows/pylint.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 19 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
4-
name: Upload Python Package
1+
name: Publish to PyPI
52

63
on:
74
release:
@@ -10,58 +7,26 @@ on:
107
jobs:
118
test:
129
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
python-version: ["3.10", "3.11", "3.12"]
16-
1710
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: ${{ matrix.python-version }}
24-
25-
- name: Cache pip dependencies
26-
uses: actions/cache@v3
27-
with:
28-
path: ~/.cache/pip
29-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
30-
restore-keys: |
31-
${{ runner.os }}-pip-${{ matrix.python-version }}-
11+
- uses: actions/checkout@v4
12+
- uses: astral-sh/setup-uv@v3
13+
- run: uv sync --frozen
14+
- run: uv run pytest tests/ -v --ignore=tests/test_integration.py
3215

33-
- name: Install dependencies
34-
run: |
35-
python -m pip install --upgrade pip
36-
pip install pytest pytest-asyncio responses
37-
cd scrapegraph-py
38-
pip install -e ".[html]"
39-
40-
- name: Run mocked tests with coverage
41-
run: |
42-
cd scrapegraph-py
43-
python -m pytest tests/test_mocked_apis.py -v --cov=scrapegraph_py --cov-report=xml --cov-report=term-missing
44-
45-
deploy:
16+
publish:
4617
needs: test
4718
runs-on: ubuntu-latest
48-
4919
steps:
50-
- uses: actions/checkout@v4
51-
- name: Set up Python
52-
uses: actions/setup-python@v5
53-
with:
54-
python-version: '3.x'
55-
- name: Install dependencies
56-
run: |
57-
python -m pip install --upgrade pip
58-
pip install setuptools wheel twine build
59-
- name: Build and publish
60-
env:
61-
TWINE_USERNAME: mvincig11
62-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
63-
run: |
64-
git fetch --all --tags
65-
cd scrapegraph-py
66-
python -m build
67-
twine upload dist/*
20+
- uses: actions/checkout@v4
21+
- uses: astral-sh/setup-uv@v3
22+
23+
- name: Build
24+
run: uv build
25+
26+
- name: Publish to PyPI
27+
env:
28+
TWINE_USERNAME: __token__
29+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
30+
run: |
31+
uv pip install twine
32+
uv run twine upload dist/*

.github/workflows/release.yml

Lines changed: 15 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,40 @@
11
name: Release
2+
23
on:
34
push:
4-
branches:
5-
- main
6-
- pre/*
5+
branches: [main]
76

87
jobs:
9-
build:
10-
name: Build
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Install git
14-
run: |
15-
sudo apt update
16-
sudo apt install -y git
17-
- name: Install uv
18-
uses: astral-sh/setup-uv@v3
19-
- name: Install Node Env
20-
uses: actions/setup-node@v4
21-
with:
22-
node-version: 20
23-
- name: Checkout
24-
uses: actions/checkout@v4.1.1
25-
with:
26-
fetch-depth: 0
27-
persist-credentials: false
28-
- name: Build app
29-
run: |
30-
cd scrapegraph-py
31-
uv sync --frozen
32-
uv build
33-
id: build_cache
34-
if: success()
35-
- name: Cache build
36-
uses: actions/cache@v4
37-
with:
38-
path: scrapegraph-py/dist
39-
key: ${{ runner.os }}-build-${{ hashFiles('scrapegraph-py/dist/**') }}
40-
if: steps.build_cache.outputs.id != ''
41-
428
release:
43-
name: Release
449
runs-on: ubuntu-latest
45-
needs: build
46-
environment: development
47-
if: |
48-
github.event_name == 'push' && github.ref == 'refs/heads/main' ||
49-
github.event_name == 'push' && github.ref == 'refs/heads/pre/beta' ||
50-
github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'main' ||
51-
github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'pre/beta'
5210
permissions:
5311
contents: write
5412
issues: write
5513
pull-requests: write
5614
id-token: write
5715
steps:
58-
- name: Checkout repo
59-
uses: actions/checkout@v4.1.1
16+
- uses: actions/checkout@v4
6017
with:
6118
fetch-depth: 0
6219
persist-credentials: false
63-
- name: Install uv
64-
uses: astral-sh/setup-uv@v3
65-
- name: Setup Python environment
66-
run: |
67-
cd ./scrapegraph-py
68-
uv sync
69-
- name: Restore build artifacts
70-
uses: actions/cache@v4
20+
21+
- uses: astral-sh/setup-uv@v3
22+
23+
- uses: actions/setup-node@v4
7124
with:
72-
path: ./scrapegraph-py/dist
73-
key: ${{ runner.os }}-build-${{ hashFiles('./scrapegraph-py/dist/**') }}
25+
node-version: 20
26+
27+
- name: Build
28+
run: |
29+
uv sync --frozen
30+
uv build
31+
7432
- name: Semantic Release
75-
uses: cycjimmy/semantic-release-action@v4.1.0
33+
uses: cycjimmy/semantic-release-action@v4
7634
env:
7735
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7836
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
7937
with:
80-
working_directory: ./scrapegraph-py
8138
semantic_version: 23
8239
extra_plugins: |
8340
semantic-release-pypi@3

.github/workflows/test.yml

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)