Skip to content

Cleanup minor mistakes missed in other PRs #412

Cleanup minor mistakes missed in other PRs

Cleanup minor mistakes missed in other PRs #412

Workflow file for this run

# Copyright 2023 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Gematria CI
on:
push:
branches:
- main
repository_dispatch:
pull_request:
jobs:
check-python-formatting:
name: Python Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install pyink
run: pip3 install pyink==23.9.1
- name: Check python formatting
run: pyink --check --diff .
check-cpp-formatting:
name: C++ Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check c++ formatting
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: '18'
check-path: 'src'
check-bazel-formatting:
name: Bazel Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: thompsonja/bazel-buildifier@v0.4.0
with:
buildifier_version: v6.1.2
check-cmake-projects:
name: Check CMake-based projects
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hendrikmuhs/ccache-action@v1.2.10
- uses: ConorMacBride/install-package@v1.1.0
with:
apt: cmake ninja-build libpthreadpool-dev
- name: Get LLVM
run: git clone --depth 1 https://github.com/llvm/llvm-project.git /tmp/llvm-project
- name: Set up TFLite
run: |
mkdir /tmp/tflite
cd /tmp/tflite
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export CMAKE_C_COMPILER_LAUNCHER=ccache
curl https://raw.githubusercontent.com/google/ml-compiler-opt/main/buildbot/build_tflite.sh | bash
- name: cmake setup
run: |
mkdir /tmp/cmake-build
cd /tmp/cmake-build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD=Native \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-C /tmp/tflite/tflite.cmake \
/tmp/llvm-project/llvm \
-DLLVM_EXTERNAL_PROJECTS=gematria \
-DLLVM_EXTERNAL_GEMATRIA_SOURCE_DIR=${{ github.workspace }}
- name: build
run: |
cd /tmp/cmake-build
ninja llvm-granite check-llvm-tools-llvm-cm
check-bazel:
name: Run bazel build
runs-on: ubuntu-latest
env:
USE_BAZEL_VERSION: 6.4.0
steps:
- uses: actions/checkout@v3
- name: Cache Bazel
uses: actions/cache@v3
with:
path: |
~/.cache/bazel
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install python deps
run: pip3 install -r requirements.txt
- name: Run build
run: bazel build ...
- name: Run tests
run: bazel test --test_tag_filters="-perf_counters" --test_output=errors ...