Compare commits
2 Commits
8e058aeefc
...
4320570778
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4320570778 | ||
|
|
8da4eb30e3 |
@@ -2,30 +2,58 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
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: |
|
||||
uname -a
|
||||
cat /etc/os-release 2>/dev/null | head -5
|
||||
- name: Install Python
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install -e ".[dev]"
|
||||
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: |
|
||||
if ! command -v python3 &> /dev/null; then
|
||||
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
||||
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
|
||||
export PATH="/app/python-3.11.0:$PATH"
|
||||
fi
|
||||
python3 --version
|
||||
- name: Install deps
|
||||
run: pip3 install -e ".[dev]"
|
||||
- name: Lint
|
||||
run: ruff check src/
|
||||
- name: Type check
|
||||
run: mypy src/
|
||||
- name: Test
|
||||
run: pytest tests/ -v
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install build
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
python -m build
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
Reference in New Issue
Block a user