jsonschema-rs/.github/workflows/build.yml

144 lines
3.3 KiB
YAML

name: ci
on:
pull_request: {}
push:
branches:
- master
jobs:
commitsar:
name: Verify commit messages
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Run commitsar
uses: docker://commitsar/commitsar
pre-commit:
name: Generic pre-commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-python@v2
with:
python-version: 3.7
- run: pip install pre-commit
- run: pre-commit run --all-files
working-directory: ./bindings/python
test-stable:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Test (stable) on ${{ matrix.os}}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cargo test --no-fail-fast
working-directory: ./jsonschema
test-python:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.6', '3.7', '3.8', '3.9']
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: python -m pip install tox
working-directory: ./bindings/python
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run ${{ matrix.python }} tox job
run: tox -e py
working-directory: ./bindings/python
test-python-sdist:
runs-on: ubuntu-latest
name: Testing Python source code distribution
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: x64
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: python -m pip install tox
working-directory: ./bindings/python
- run: tox -e build-sdist
working-directory: ./bindings/python
- name: Installing sdist
run: pip install dist/*
working-directory: ./bindings/python
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- run: cargo fmt --all -- --check
working-directory: ./jsonschema
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- run: cargo clippy --all-targets --all-features -- -D warnings
working-directory: ./jsonschema