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

244 lines
5.9 KiB
YAML
Raw Normal View History

2020-05-14 12:57:14 +00:00
name: ci
2020-04-15 19:05:06 +00:00
on:
pull_request: {}
push:
branches:
- master
2020-04-15 19:05:06 +00:00
jobs:
commitsar:
name: Verify commit messages
2022-04-01 07:38:05 +00:00
runs-on: ubuntu-20.04
2020-04-15 19:05:06 +00:00
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Run commitsar
uses: docker://commitsar/commitsar
2020-05-17 15:35:11 +00:00
pre-commit:
name: Generic pre-commit checks
2022-04-01 07:38:05 +00:00
runs-on: ubuntu-20.04
2020-05-17 15:35:11 +00:00
steps:
- uses: actions/checkout@v2
2020-05-17 15:35:11 +00:00
with:
fetch-depth: 1
- uses: actions/setup-python@v2
2020-05-17 15:35:11 +00:00
with:
python-version: 3.9
2020-05-17 15:35:11 +00:00
- run: pip install pre-commit
- run: pre-commit run --all-files
working-directory: ./bindings/python
2020-05-17 15:35:11 +00:00
2020-05-14 10:22:55 +00:00
test-stable:
2020-06-21 21:57:14 +00:00
strategy:
fail-fast: false
matrix:
2022-04-01 07:38:05 +00:00
os: [ubuntu-20.04, macos-11, windows-2019]
2021-10-24 14:17:20 +00:00
draft: [draft201909, draft202012]
2020-06-21 21:57:14 +00:00
2021-10-24 14:17:20 +00:00
name: Test ${{ matrix.draft }} (stable) on ${{ matrix.os}}
2020-06-21 21:57:14 +00:00
runs-on: ${{ matrix.os }}
2020-05-11 18:05:44 +00:00
steps:
- uses: actions/checkout@v2
with:
submodules: true
2020-05-11 18:05:44 +00:00
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
2022-05-03 14:57:30 +00:00
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-${{ matrix.os }}-${{ matrix.draft }}-cargo-cache
2021-10-24 14:17:20 +00:00
- run: cargo test --no-fail-fast --features ${{ matrix.draft }}
working-directory: ./jsonschema
2020-05-11 18:05:44 +00:00
build-wasm32:
strategy:
fail-fast: false
matrix:
target: ['wasm32-unknown-unknown']
name: Build on ${{ matrix.target }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-${{ matrix.target }}-cargo-cache
- run: cargo build --target ${{ matrix.target }} --no-default-features --features=cli
working-directory: ./jsonschema
2021-01-29 08:57:49 +00:00
coverage:
name: Run test coverage
2022-04-01 07:38:05 +00:00
runs-on: ubuntu-20.04
2021-01-29 08:57:49 +00:00
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Toolchain setup
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Install grcov
run: cargo install cargo-tarpaulin
2022-05-03 14:57:30 +00:00
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: coverage-cargo-cache
2021-01-29 08:57:49 +00:00
- name: Run tests
run: cargo +nightly tarpaulin --verbose --all-features --out Xml
working-directory: ./jsonschema
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
if: ${{ env.GITHUB_REPOSITORY }} == 'Stranger6667/jsonschema-rs'
with:
name: coverage
2020-05-17 15:35:11 +00:00
test-python:
strategy:
fail-fast: false
2020-05-17 15:35:11 +00:00
matrix:
2022-04-01 07:38:05 +00:00
os: [ubuntu-20.04, macos-11, windows-2019]
2023-01-14 20:26:15 +00:00
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
2020-05-17 15:35:11 +00:00
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
2020-05-17 15:35:11 +00:00
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
2020-05-17 15:35:11 +00:00
with:
python-version: ${{ matrix.python-version }}
architecture: x64
2020-05-17 15:35:11 +00:00
- run: python -m pip install tox
working-directory: ./bindings/python
2020-05-17 15:35:11 +00:00
- uses: actions-rs/toolchain@v1
with:
2020-11-09 19:01:24 +00:00
toolchain: stable
override: true
2022-05-03 14:57:30 +00:00
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: python-${{ matrix.python-version }}-${{ matrix.os }}-cargo-cache
2020-05-17 15:35:11 +00:00
- name: Run ${{ matrix.python }} tox job
run: tox -e py
working-directory: ./bindings/python
test-python-sdist:
2022-04-01 07:38:05 +00:00
runs-on: ubuntu-20.04
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
2020-04-15 19:05:06 +00:00
fmt:
name: Rustfmt
2022-04-01 07:38:05 +00:00
runs-on: ubuntu-20.04
2020-04-15 19:05:06 +00:00
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
2020-06-21 21:57:14 +00:00
components: rustfmt
- run: cargo fmt --all -- --check
working-directory: ./jsonschema
2020-04-15 19:05:06 +00:00
clippy:
name: Clippy
2022-04-01 07:38:05 +00:00
runs-on: ubuntu-20.04
2020-04-15 19:05:06 +00:00
steps:
- uses: actions/checkout@v2
with:
submodules: true
2020-04-15 19:05:06 +00:00
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
2020-06-21 21:57:14 +00:00
components: clippy
- run: cargo clippy --all-targets --all-features -- -D warnings
working-directory: ./jsonschema
2022-04-21 15:12:17 +00:00
features:
name: Check features
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: taiki-e/install-action@cargo-hack
- run: cargo hack check --feature-powerset --lib
working-directory: ./jsonschema