CI #340
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 6 * * MON' # Every Monday morning | |
jobs: | |
test: | |
name: 'Test' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.12'] | |
node-version: ['18.x'] | |
mbtest-version: ['2.9'] | |
os: ['ubuntu-latest'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install build tools | |
run: python3 -m pip install --upgrade pip setuptools wheel tox~=3.0 | |
- name: Install mbtest ${{ matrix.mbtest-version }} | |
env: | |
MBTEST_VERSION: ${{ matrix.mbtest-version }} | |
run: npm install mountebank@$MBTEST_VERSION --omit=dev | |
- name: Show software versions | |
run: | | |
python3 --version | |
node --version | |
npm --version | |
docker --version | |
docker compose version | |
- name: Run Tests | |
env: | |
MBTEST_VERSION: ${{ matrix.mbtest-version }} | |
# Run tox using the version of Python in `PATH` | |
run: tox -e py | |
test-py-versions: | |
name: 'Test Python versions' | |
needs: test | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
matrix: | |
python: ['3.11', '3.10', '3.9', '3.8', 'pypy-3.10'] | |
node-version: ['18.x'] | |
mbtest-version: ['2.9'] | |
os: ['ubuntu-latest'] | |
experimental: [false] | |
include: | |
- python: '3.13.0-alpha - 3.13.0' | |
experimental: true | |
node-version: '18.x' | |
mbtest-version: '2.9' | |
os: 'ubuntu-latest' | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install build tools | |
run: python3 -m pip install --upgrade pip setuptools wheel tox~=3.0 | |
- name: Install mbtest ${{ matrix.mbtest-version }} | |
env: | |
MBTEST_VERSION: ${{ matrix.mbtest-version }} | |
run: npm install mountebank@$MBTEST_VERSION --omit=dev | |
- name: Run Tests | |
env: | |
MBTEST_VERSION: ${{ matrix.mbtest-version }} | |
# Run tox using the version of Python in `PATH` | |
run: tox -e py | |
test-mb-versions: | |
name: 'Test Mountebank versions' | |
needs: test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.12'] | |
node-version: ['16.x'] | |
mbtest-version: ['2.8', '2.0', '1.16'] | |
os: ['ubuntu-latest'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install build tools | |
run: python3 -m pip install --upgrade pip setuptools wheel tox~=3.0 | |
- name: Install mbtest ${{ matrix.mbtest-version }} | |
env: | |
MBTEST_VERSION: ${{ matrix.mbtest-version }} | |
run: npm install mountebank@$MBTEST_VERSION --omit=dev | |
- name: Run Tests | |
env: | |
MBTEST_VERSION: ${{ matrix.mbtest-version }} | |
# Run tox using the version of Python in `PATH` | |
run: tox -e py | |
test-oses: | |
name: 'Test OSes' | |
needs: test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.12'] | |
node-version: ['18.x'] | |
mbtest-version: ['2.9'] | |
os: ['windows-latest', 'macos-latest'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install build tools | |
run: python3 -m pip install --upgrade pip setuptools wheel tox~=3.0 | |
- name: Install mbtest ${{ matrix.mbtest-version }} | |
env: | |
MBTEST_VERSION: ${{ matrix.mbtest-version }} | |
run: npm install mountebank@$MBTEST_VERSION --omit=dev | |
- name: Run Tests | |
env: | |
MBTEST_VERSION: ${{ matrix.mbtest-version }} | |
# Run tox using the version of Python in `PATH` | |
run: tox -e py | |
coverage: | |
name: 'Check coverage' | |
needs: test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.12'] | |
node-version: ['18.x'] | |
mbtest-version: ['2.9'] | |
os: ['ubuntu-latest'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install build tools | |
run: python3 -m pip install --upgrade pip setuptools wheel tox~=3.0 | |
- name: Install mbtest ${{ matrix.mbtest-version }} | |
env: | |
MBTEST_VERSION: ${{ matrix.mbtest-version }} | |
run: npm install mountebank@$MBTEST_VERSION --omit=dev | |
- name: Check coverage | |
env: | |
MBTEST_VERSION: ${{ matrix.mbtest-version }} | |
run: tox -e coverage | |
lint-etc: | |
name: 'Linting and docs' | |
needs: test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: [ '3.12' ] | |
os: [ 'ubuntu-latest' ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install build tools | |
run: python3 -m pip install --upgrade pip setuptools wheel tox~=3.0 | |
- name: Check format | |
run: tox -e check-format | |
- name: Lint | |
run: tox -e flake8 refurb | |
- name: Security checks | |
run: tox -e bandit | |
- name: Check types | |
run: tox -e pyright,mypy | |
- name: Build docs | |
run: tox -e docs |