Skip to content

CI

CI #261

Workflow file for this run

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.11']
node-version: ['18.x']
mbtest-version: ['2.8']
os: ['ubuntu-latest']
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
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-py-versions:
name: 'Test Python versions'
needs: test
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
python: ['3.10', '3.9', '3.8', 'pypy-3.8']
node-version: ['18.x']
mbtest-version: ['2.8']
os: ['ubuntu-latest']
experimental: [false]
include:
- python: '3.12.0-alpha - 3.12.0'
experimental: true
node-version: '18.x'
mbtest-version: '2.8'
os: 'ubuntu-latest'
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
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.11']
node-version: ['16.x']
mbtest-version: ['2.7', '2.6', '2.0', '1.16']
os: ['ubuntu-latest']
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
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.11']
node-version: ['18.x']
mbtest-version: ['2.8']
os: ['windows-latest', 'macos-latest']
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install build tools
run: python3 -m pip install --upgrade pip setuptools wheel tox~=3.0
- name: Install and Start Colima
run: |
if [[ "${{ matrix.os }}" == *"macos"* ]]
then
brew install docker docker-compose
colima start
fi
shell: bash
- 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.11']
node-version: ['18.x']
mbtest-version: ['2.8']
os: ['ubuntu-latest']
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
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.11' ]
os: [ 'ubuntu-latest' ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v4
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,safety
- name: Check types
run: tox -e pyright,mypy
- name: Build docs
run: tox -e docs