Skip to content

Do not stop after the first failure in fmt and support --json #986

Do not stop after the first failure in fmt and support --json

Do not stop after the first failure in fmt and support --json #986

Workflow file for this run

name: CI
on:
pull_request:
jobs:
codespell:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get update && sudo apt-get install --yes codespell
- uses: actions/checkout@v4
- run: codespell docs *.markdown
test:
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-22.04
type: native
cc: gcc
cxx: g++
shell: sh
- os: ubuntu-22.04-arm
type: native
cc: gcc
cxx: g++
shell: sh
- os: macos-15-intel
type: native
cc: clang
cxx: clang++
shell: sh
- os: macos-15
type: native
cc: clang
cxx: clang++
shell: sh
- os: windows-2022
type: native
shell: pwsh
- os: windows-2022
type: wsl-2
shell: wsl-bash {0}
defaults:
run:
shell: ${{ matrix.platform.shell }}
runs-on: ${{ matrix.platform.os }}
env:
CC: ${{ matrix.platform.cc }}
CXX: ${{ matrix.platform.cxx }}
steps:
# See https://github.com/Vampire/setup-wsl
- uses: Vampire/setup-wsl@v5
if: runner.os == 'windows' && matrix.platform.type == 'wsl-2'
with:
distribution: Ubuntu-22.04
additional-packages: cmake build-essential shellcheck pipx zsh
wsl-version: 2
- name: Install pre-commit
run: pipx install pre-commit
- name: Surface pipx binaries to WSL
run: |
ln -s -v /root/.local/bin/pre-commit /usr/bin/pre-commit
if: runner.os == 'windows' && matrix.platform.type == 'wsl-2'
- uses: actions/checkout@v4
- name: Install dependencies (macOS)
if: runner.os == 'macos'
run: brew bundle
env:
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
- name: Install dependencies (Windows)
if: runner.os == 'windows' && matrix.platform.type == 'native'
run: choco install shellcheck
- name: Install dependencies (Linux)
if: runner.os == 'linux'
run: sudo apt-get update --yes && sudo apt-get install --yes zsh
- run: cmake --version
- name: Configure JSON Schema
run: >
cmake -S . -B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DJSONSCHEMA_PORTABLE:BOOL=ON
-DJSONSCHEMA_TESTS:BOOL=ON
-DJSONSCHEMA_TESTS_CI:BOOL=ON
-DJSONSCHEMA_DEVELOPMENT:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON
- run: cmake --build ./build --config Release --target clang_format_test
- run: cmake --build ./build --config Release --target shellcheck
- run: cmake --build ./build --config Release --parallel 4
- run: >
cmake --install ./build --prefix ./build/dist --config Release --verbose
--component sourcemeta_jsonschema
# Not every CTest version supports the --test-dir option. If such option
# is not recognized, `ctest` will successfully exit finding no tests.
# Better to be sure and `cd` all the time here.
- run: cd ./build && ctest --build-config Release --output-on-failure --parallel
- run: cpack --config build/CPackConfig.cmake -B build/out -C Release
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker build --tag jsonschema .
- run: docker run --interactive --volume "$PWD:/schema" jsonschema
- run: ./test/docker/help.sh
- run: ./test/docker/bundle_fmt.sh
snap:
strategy:
fail-fast: false
matrix:
image: [ ubuntu-24.04, ubuntu-24.04-arm ]
runs-on: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- uses: snapcore/action-build@v1
id: snapcraft
- run: sudo snap install --dangerous --classic ${{ steps.snapcraft.outputs.snap }}
- run: jsonschema version
- run: mkdir "$PWD/build"
- run: TMPDIR="$PWD/build" ./test/lint/fail_lint.sh jsonschema
- run: TMPDIR="$PWD/build" ./test/bundle/pass_resolve_single.sh jsonschema
- run: TMPDIR="$PWD/build" ./test/ci/pass_validate_http_verbose.sh jsonschema