Repository navigation
76 lines (71 loc) · 2.27 KB
/
Copy pathci.yml
File metadata and controls
76 lines (71 loc) · 2.27 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Check imports
run: python -c "from chatgpt_web2api import __version__; from chatgpt_web2api.mcp_server import create_server; print('OK v' + __version__)"
- name: Ruff (E/F/I/UP)
run: ruff check src/ tests/
secret-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Full history so gitleaks can scan past commits, not just the diff.
fetch-depth: 0
# Install the gitleaks binary directly instead of the gitleaks-action.
# The action now requires a paid GITLEAKS_LICENSE for organizations
# (Octo-Lex is an org), so it errors out before scanning. The binary is
# free (Apache-2.0) and scans the same — no license needed.
- name: Install gitleaks
run: |
curl -sSL https://github.com/gitleaks/gitleaks/releases/download/v8.21.2/gitleaks_8.21.2_linux_x64.tar.gz \
| sudo tar -xz -C /usr/local/bin gitleaks
gitleaks version
- name: Gitleaks scan
run: gitleaks detect --source . --redact --verbose
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run tests
run: pytest -v -m "not e2e"
build:
runs-on: ubuntu-latest
needs: [lint, secret-scan, test]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build package
run: |
pip install build
python -m build
- name: Check package
run: |
pip install dist/*.whl
chatgpt-web2api --help
chatgpt-web2api-mcp --help