Skip to content

Commit

Permalink
Merge branch 'pytorch:main' into adjust-log-level
Browse files Browse the repository at this point in the history
  • Loading branch information
prashanthswami authored Jan 11, 2024
2 parents cc93df1 + 76cc10d commit 9846fbf
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
1 change: 0 additions & 1 deletion .bazelversion

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
pull_request:
push:
branches:
- master
- main

permissions:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/build_bazel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build using Bazel
on:
pull_request:
push:
branches:
- main

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
bazel-linux-local:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
- name: Build
run: scripts/local-bazel-build.sh
18 changes: 18 additions & 0 deletions scripts/local-bazel-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Copyright 2024 Google LLC

set -e

BAZEL_ARGS=()

# Bazel-level configuration
#
# If editing these flags, make sure `local-build.sh` flags are updated.
BAZEL_ARGS+=("-c=\"opt\"")
BAZEL_ARGS+=("-copt=\"fpic\"")

# User-specified Bazel arguments go last to allow overridding defaults
BAZEL_ARGS+=($@)

# Build all targets
bazel build :all
4 changes: 3 additions & 1 deletion scripts/local-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ mkdir -p build/local
CMAKE_ARGS=()

# CMake-level configuration
#
# If editing these flags, make sure `local-build-bazel.sh` flags are updated.
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
CMAKE_ARGS+=("-DCMAKE_POSITION_INDEPENDENT_CODE=ON")

Expand All @@ -22,7 +24,7 @@ then
CMAKE_ARGS+=("-GNinja")
fi

# Use-specified CMake arguments go last to allow overridding defaults
# User-specified CMake arguments go last to allow overridding defaults
CMAKE_ARGS+=($@)

cd build/local && cmake ../.. \
Expand Down

0 comments on commit 9846fbf

Please sign in to comment.