Use version agnostic homebrew prefix (#58) #175
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: IncludeJS | |
| on: | |
| push: | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - os: macos-latest | |
| cc: clang | |
| cxx: clang++ | |
| type: static | |
| backend: JavaScriptCore | |
| - os: macos-latest | |
| cc: clang | |
| cxx: clang++ | |
| type: shared | |
| backend: JavaScriptCore | |
| # TODO(RaisinTen): Support other OSs and static configuration for | |
| # the V8 backend. | |
| - os: macos-latest | |
| cc: clang | |
| cxx: clang++ | |
| type: shared | |
| backend: V8 | |
| - os: ubuntu-latest | |
| cc: clang | |
| cxx: clang++ | |
| type: static | |
| backend: JavaScriptCore | |
| - os: ubuntu-latest | |
| cc: gcc | |
| cxx: g++ | |
| type: static | |
| backend: JavaScriptCore | |
| - os: ubuntu-latest | |
| cc: clang | |
| cxx: clang++ | |
| type: shared | |
| backend: JavaScriptCore | |
| - os: ubuntu-latest | |
| cc: gcc | |
| cxx: g++ | |
| type: shared | |
| backend: JavaScriptCore | |
| # Sanitizers | |
| - os: ubuntu-latest | |
| cc: clang | |
| cxx: clang++ | |
| type: static | |
| options: -DINCLUDEJS_ADDRESS_SANITIZER:BOOL=ON | |
| backend: JavaScriptCore | |
| - os: ubuntu-latest | |
| cc: clang | |
| cxx: clang++ | |
| type: static | |
| options: -DINCLUDEJS_UNDEFINED_SANITIZER:BOOL=ON | |
| backend: JavaScriptCore | |
| - os: macos-latest | |
| cc: clang | |
| cxx: clang++ | |
| type: static | |
| options: -DINCLUDEJS_ADDRESS_SANITIZER:BOOL=ON | |
| backend: JavaScriptCore | |
| - os: macos-latest | |
| cc: clang | |
| cxx: clang++ | |
| type: static | |
| options: -DINCLUDEJS_UNDEFINED_SANITIZER:BOOL=ON | |
| backend: JavaScriptCore | |
| runs-on: ${{ matrix.platform.os }} | |
| env: | |
| CC: ${{ matrix.platform.cc }} | |
| CXX: ${{ matrix.platform.cxx }} | |
| steps: | |
| - name: Install dependencies (GNU/Linux) | |
| if: runner.os == 'linux' | |
| run: | | |
| sudo apt-get update --yes | |
| sudo apt-get install --yes libjavascriptcoregtk-4.1-dev | |
| - 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 ClangFormat | |
| run: pip install clang-format==18.1.0 | |
| - run: cmake --version | |
| - name: Configure IncludeJS (static) | |
| if: matrix.platform.type == 'static' | |
| run: > | |
| cmake -S . -B ./build | |
| -DCMAKE_BUILD_TYPE:STRING=Release | |
| -DINCLUDEJS_BACKEND:STRING=${{ matrix.platform.backend }} | |
| -DINCLUDEJS_TESTS:BOOL=ON | |
| -DINCLUDEJS_DOCS:BOOL=OFF | |
| -DBUILD_SHARED_LIBS:BOOL=OFF | |
| -DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON | |
| ${{ matrix.platform.options }} | |
| - name: Configure IncludeJS (shared) | |
| if: matrix.platform.type == 'shared' | |
| run: > | |
| cmake -S . -B ./build | |
| -DCMAKE_BUILD_TYPE:STRING=Release | |
| -DINCLUDEJS_BACKEND:STRING=${{ matrix.platform.backend }} | |
| -DINCLUDEJS_TESTS:BOOL=ON | |
| -DINCLUDEJS_DOCS:BOOL=OFF | |
| -DBUILD_SHARED_LIBS:BOOL=ON | |
| -DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON | |
| ${{ matrix.platform.options }} | |
| - run: cmake --build ./build --config Release --target clang_format_test | |
| - run: cmake --build ./build --config Release --parallel 4 | |
| - run: > | |
| cmake --install ./build --prefix ./build/dist --config Release --verbose | |
| --component includejs | |
| - run: > | |
| cmake --install ./build --prefix ./build/dist --config Release --verbose | |
| --component includejs_dev | |
| # 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 | |
| env: | |
| # See https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html | |
| UBSAN_OPTIONS: print_stacktrace=1 |