Skip to content

update

update #163

name: Build and test all
on:
push:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
env:
BAZEL_VERSION: 4.2.2
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
include:
- os: macos-latest
bazel-target: darwin
- os: ubuntu-latest
bazel-target: linux
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} for Linux
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up bazel
run: |
curl -LO https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-${{ matrix.bazel-target }}-x86_64.sh
chmod +x bazel-${BAZEL_VERSION}-installer-${{ matrix.bazel-target }}-x86_64.sh
./bazel-${BAZEL_VERSION}-installer-${{ matrix.bazel-target }}-x86_64.sh --user
export PATH="$PATH:$HOME/bin"
rm bazel-${BAZEL_VERSION}-installer-${{ matrix.bazel-target }}-x86_64.sh
- name: (macos) install clang-format
if: matrix.os == 'macos-latest'
run: |
brew install clang-format
which clang-format
- name: Build and test all modules
run: |
bazel build //... --loading_phase_threads 2
bazel test //...
- name: Run build pip pkg
run: |
pip install wheel
bazel build //nori/python:build_pip_pkg
./bazel-bin/nori/python/build_pip_pkg dist
- name: Upload pip package artifact
uses: actions/upload-artifact@v2
with:
name: nori-clone pip package
path: dist