Update precommit.yml #154
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
| # A workflow to run Bazel builds and tests. | |
| name: precommit | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'beta' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| name: Build+test ${{ matrix.cfg.name }} | |
| runs-on: ${{ matrix.cfg.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| cfg: | |
| - { name: 'Linux GCC', os: 'ubuntu-22.04', cc: gcc-12, cxx: g++-12, config: } | |
| - { name: 'Linux LLVM+libstdc++', os: 'ubuntu-22.04', cc: clang, cxx: clang++, config: --linkopt=-fuse-ld=lld } | |
| - { name: 'Linux LLVM+libc++', os: 'ubuntu-22.04', cc: clang, cxx: clang++, config: --config=libc++ --linkopt=-fuse-ld=lld } | |
| - { name: 'MacOS 13 x86_64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, config: --config=libc++ --config=macos } | |
| - { name: 'MacOS 13 ARM64 LLVM+libc++', os: 'macos-13', cc: clang, cxx: clang++, config: --config=libc++ --config=macos_arm64 } | |
| bazel-version: | |
| - '6.3.0' | |
| python-version: | |
| - '3.10' | |
| env: | |
| CC: ${{ matrix.cfg.cc }} | |
| CXX: ${{ matrix.cfg.cxx }} | |
| USE_BAZEL_VERSION: ${{ matrix.bazel-version }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: install infrastructure (Linux) | |
| if: startsWith( matrix.cfg.os, 'ubuntu-' ) | |
| run: | | |
| sudo apt-get install \ | |
| python${{ matrix.python-version }}-dev \ | |
| python3-numpy \ | |
| python3-packaging | |
| sudo ln -s /usr/lib/llvm-10/include/c++/v1 /usr/include/c++/v1 | |
| - name: install infrastructure (MacOS) | |
| if: startsWith( matrix.cfg.os, 'macos-' ) | |
| run: | | |
| brew --version | |
| brew unlink python3 | |
| python3 --version | |
| brew install python@${{ matrix.python-version }} | |
| brew unlink python3 | |
| brew link --force python@${{ matrix.python-version }} | |
| python3 --version | |
| alias python3=python${{ matrix.python-version }} | |
| python3 --version | |
| brew install python-packaging | |
| brew install numpy | |
| - name: show setup | |
| run: | | |
| bazel --version | |
| python3 --version | |
| python3.10 --version | |
| pip3 --version | |
| pip3 list | |
| # - name: build-lua5.1 | |
| # run: | | |
| # bazel --bazelrc=.bazelrc build --config=lua5_1 ${{ matrix.config }} //... | |
| # - name: test-lua5.1 | |
| # if: (!contains(matrix.cfg.config, 'arm64')) | |
| # run: | | |
| # bazel --bazelrc=.bazelrc test --config=lua5_1 ${{ matrix.config }} --test_output=errors //... | |
| # - name: build-lua5.2 | |
| # run: | | |
| # bazel --bazelrc=.bazelrc build --config=lua5_2 ${{ matrix.config }} //... | |
| # - name: test-lua5.2 | |
| # if: (!contains(matrix.cfg.config, 'arm64')) | |
| # run: | | |
| # bazel --bazelrc=.bazelrc test --config=lua5_2 ${{ matrix.config }} --test_output=errors //... | |
| - name: build-luajit | |
| run: | | |
| bazel --bazelrc=.bazelrc build --config=luajit ${{ matrix.config }} //... | |
| - name: test-luajit | |
| if: (!contains(matrix.cfg.config, 'arm64')) | |
| run: | | |
| bazel --bazelrc=.bazelrc test --config=luajit ${{ matrix.config }} --test_output=errors //... | |
| - name: build-luajit-internal_unwind | |
| run: | | |
| bazel --bazelrc=.bazelrc build --config=luajit ${{ matrix.config }} --copt=-fno-asynchronous-unwind-tables --luajit_external_unwinder=False //... | |
| - name: test-luajit-internal_unwind | |
| if: (!contains(matrix.cfg.config, 'arm64')) | |
| run: | | |
| bazel --bazelrc=.bazelrc test --config=luajit ${{ matrix.config }} --copt=-fno-asynchronous-unwind-tables --luajit_external_unwinder=False --test_output=errors //... |