204 lines
5.6 KiB
YAML
204 lines
5.6 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@v1
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- run: pip install pre-commit
|
|
- run: pre-commit run --all-files
|
|
working-directory: ./python
|
|
|
|
check:
|
|
name: Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: check
|
|
|
|
test-stable:
|
|
name: Test (stable)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- name: Start background server # User for integration tests
|
|
run: |
|
|
# This assumes that python3 is installed on the system
|
|
/usr/bin/env python3 -m pip install flask
|
|
# Starts the server in background
|
|
/usr/bin/env python3 ./tests/suite/bin/jsonschema_suite serve &
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --no-fail-fast
|
|
|
|
test-nightly:
|
|
name: Test + Coverage (nightly)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- name: Start background server # User for integration tests
|
|
run: |
|
|
# This assumes that python3 is installed on the system
|
|
/usr/bin/env python3 -m pip install flask
|
|
# Starts the server in background
|
|
/usr/bin/env python3 ./tests/suite/bin/jsonschema_suite serve &
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
override: true
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: clean
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --no-fail-fast
|
|
env:
|
|
CARGO_INCREMENTAL: '0'
|
|
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
|
|
RUSTDOCFLAGS: '-Cpanic=abort'
|
|
- id: coverage
|
|
uses: actions-rs/grcov@v0.1
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v1.0.5
|
|
with:
|
|
name: coverage
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
file: ${{ steps.coverage.outputs.report }}
|
|
|
|
test-python:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
python: [3.5, 3.6, 3.7, 3.8]
|
|
|
|
name: Python ${{ matrix.python }} on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
- name: Start background server # User for integration tests
|
|
run: |
|
|
# This assumes that python3 is installed on the system
|
|
/usr/bin/env python3 -m pip install flask
|
|
# Starts the server in background
|
|
/usr/bin/env python3 ./tests/suite/bin/jsonschema_suite serve &
|
|
|
|
- run: /usr/bin/env python3 -m pip install setuptools_rust tox
|
|
working-directory: ./python
|
|
|
|
- run: ./build-sdist.sh
|
|
working-directory: ./python
|
|
|
|
- name: Run ${{ matrix.python }} tox job
|
|
run: tox -e py${TOX_JOB//.} # Strip dot from python version to match tox job
|
|
working-directory: ./python
|
|
env:
|
|
TOX_JOB: ${{ matrix.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
|
|
- run: rustup component add rustfmt
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: fmt
|
|
args: --all -- --check
|
|
|
|
clippy:
|
|
name: Clippy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- run: rustup component add clippy
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: clippy
|
|
args: -- -D warnings
|
|
benchmark:
|
|
name: Benchmark
|
|
runs-on: ubuntu-latest
|
|
if: "contains(github.event.head_commit.message, '[bench]') || contains(github.event.head_commit.message, '[benchmark]')"
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: bench
|
|
args: jsonschema-rs # Run the benchmarks only for the `jsonschema` package
|
|
benchmark-all:
|
|
name: Benchmark All
|
|
runs-on: ubuntu-latest
|
|
if: "contains(github.event.head_commit.message, '[bench-all]') || contains(github.event.head_commit.message, '[benchmark-all]')"
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: bench
|