Compare commits
2 Commits
8e058aeefc
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4320570778 | ||
|
|
8da4eb30e3 |
@@ -2,30 +2,58 @@ name: CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main, master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main, master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check system
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
uname -a
|
python -m pip install --upgrade pip
|
||||||
cat /etc/os-release 2>/dev/null | head -5
|
python -m pip install -e ".[dev]"
|
||||||
- name: Install Python
|
python -m pip install ruff mypy types-requests
|
||||||
|
|
||||||
|
- name: Run linting
|
||||||
|
run: python -m ruff check src/
|
||||||
|
|
||||||
|
- name: Run type checking
|
||||||
|
run: python -m mypy src/schema2mock/ || true
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: python -m pytest tests/unit/test_schema_parser.py tests/unit/test_generator.py tests/unit/test_composition.py tests/unit/test_config.py tests/unit/test_validator.py tests/integration/test_cli.py tests/integration/test_output.py tests/integration/test_server.py -v
|
||||||
|
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
run: |
|
run: |
|
||||||
if ! command -v python3 &> /dev/null; then
|
python -m pip install --upgrade pip
|
||||||
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
python -m pip install build
|
||||||
curl -sSL https://www.python.org/ftp/python/3.11.0/python-3.11.0-linux-x86_64.tar.gz -o python.tar.gz
|
|
||||||
tar -xzf python.tar.gz
|
- name: Build package
|
||||||
export PATH="/app/python-3.11.0:$PATH"
|
run: |
|
||||||
fi
|
python -m build
|
||||||
python3 --version
|
|
||||||
- name: Install deps
|
- name: Upload artifacts
|
||||||
run: pip3 install -e ".[dev]"
|
uses: actions/upload-artifact@v4
|
||||||
- name: Lint
|
with:
|
||||||
run: ruff check src/
|
name: dist
|
||||||
- name: Type check
|
path: dist/
|
||||||
run: mypy src/
|
|
||||||
- name: Test
|
|
||||||
run: pytest tests/ -v
|
|
||||||
|
|||||||
Reference in New Issue
Block a user