Skip to content

Commit

Permalink
Merge pull request #65 from VSuryaprasad-HCL/New_1
Browse files Browse the repository at this point in the history
Testsing pre-submit checks
  • Loading branch information
VSuryaprasad-HCL authored Jan 7, 2025
2 parents 1c44b64 + 9785f58 commit 6b496ff
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 8 deletions.
42 changes: 34 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,37 @@ on:
jobs:
build:
name: Bazel Build and Test
run: |
grep -r 'butter\|financial\|exchange\|stock\|market\|trading\|GCPTP\|CME\|bubble\|coarse-grained equalization\|CGE\|coarse' *
if [ $? -eq 0 ]
then
echo "Keyword Check Failed. Pl. check and fix it"
else
echo "Keyword check Passed."
fi
# We use Ubuntu 20.04 as it comes with GCC v9.3 by default.
runs-on: ubuntu-20.04
env:
BAZEL_CACHE_USER: github
BAZEL_CACHE_PWD: ${{ secrets.BAZEL_CACHE_PWD }}
BAZEL_CACHE_URL: pins-bazel-cache.onf.dev:9090

steps:
- uses: actions/checkout@v2

- name: Mount bazel cache
uses: actions/cache@v2
with:
# See https://docs.bazel.build/versions/master/output_directories.html
path: "/tmp/repo-cache"
# See https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
key: bazel-repo-cache-v1-${{ runner.os }}-${{ hashFiles('**/*_deps.bzl', '.bazelrc', '.bazelversion', 'WORKSPACE.bazel') }}
restore-keys: |
bazel-repo-cache-v1-${{ runner.os }}-
- name: Install system dependencies
run: ./install_dependencies.sh

- name: Install bazelisk
run: |
ARCH=$(dpkg --print-architecture)
sudo curl -fsSL -o /usr/local/bin/bazel \
https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-${ARCH}
sudo chmod +x /usr/local/bin/bazel
# Authentication is enabled for R/W access for builds on main and branch PRs
# Unauthenticated reads are allowed for PRs from forks
- name: Build and Test
run: bazel build ...
74 changes: 74 additions & 0 deletions install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash
# Copyright 2021 Google LLC
#
# Please read carefully before adding new dependencies:
#
# System dependencies are disallowed by default, and the bar for exceptions is
# high.
#
# pins-infra strives for a hermetic build, i.e. one that is insensitive to the
# libraries and other software installed on your machine, other than Bazel and
# the compilers. This ensure the build is reproducible and portable.
#
# Before adding a new system dependency, consider the following:
#
# 1. Please read the note on dependencies in pins_infra_deps.bzl.
#
# 2. Can the dependency be avoided altogether? Consider that there is a
# non-trival cost to maintaining dependencies over time.
#
# 3. Can the dependency be built with Bazel instead?
# - For many libraries, there are existing Bazel BUILD files. Try a quick
# Google search.
# - If there is no existing BUILD file, can you write your own BUILD file?
# See the bazel/ folder for examples. Ideally, we strive to upstream such
# BUILD files so everyone can benefit and share the maintenance burden.
# - If it's too hard to write a native BUILD file, try writing a BUILD file
# using rules_foreign_cc (https://github.com/bazelbuild/rules_foreign_cc).
#. See the bazel/ folder for examples.

# Please read carefully before adding new dependencies:
#
# System dependencies are disallowed by default, and the bar for exceptions is
# high.
#
# pins-infra strives for a hermetic build, i.e. one that is insensitive to the
# libraries and other software installed on your machine, other than Bazel and
# the compilers. This ensure the build is reproducible and portable.
#
# Before adding a new system dependency, consider the following:
#
# 1. Please read the note on dependencies in pins_infra_deps.bzl.
#
# 2. Can the dependency be avoided altogether? Consider that there is a
# non-trival cost to maintaining dependencies over time.
#
# 3. Can the dependency be built with Bazel instead?
# - For many libraries, there are existing Bazel BUILD files. Try a quick
# Google search.
# - If there is no existing BUILD file, can you write your own BUILD file?
# See the bazel/ folder for examples. Ideally, we strive to upstream such
# BUILD files so everyone can benefit and share the maintenance burden.
# - If it's too hard to write a native BUILD file, try writing a BUILD file
# using rules_foreign_cc (https://github.com/bazelbuild/rules_foreign_cc).
#. See the bazel/ folder for examples.

# TODO: Avoid system dependencies like libnl, currently these are
# coming because Sonic swss common depends on them.
sudo apt-get update
sudo apt-get install \
bison \
flex \
libfl-dev \
libgmp-dev \
libhiredis-dev \
libnl-3-dev \
libnl-genl-3-dev \
libnl-route-3-dev \
libnl-nf-3-dev \
libboost-dev \
libboost-serialization-dev \
libyang-dev \
libzmq3-dev \
uuid-dev \
nlohmann-json3-dev

0 comments on commit 6b496ff

Please sign in to comment.