Skip to content

Commit bf3ba52

Browse files
first commit
0 parents  commit bf3ba52

File tree

1,546 files changed

+227715
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,546 files changed

+227715
-0
lines changed

.bazelrc

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
#
16+
# TFLM Bazel configuration file.
17+
18+
# Use the following C++ standard
19+
build --cxxopt -std=c++17
20+
21+
# When building with the address sanitizer
22+
# E.g., bazel build --config asan
23+
build:asan --repo_env CC=clang
24+
build:asan --strip=never
25+
build:asan --copt -fsanitize=address
26+
build:asan --copt -DADDRESS_SANITIZER
27+
build:asan --copt -g
28+
build:asan --copt -O3
29+
build:asan --copt -fno-omit-frame-pointer
30+
build:asan --linkopt -fsanitize=address
31+
32+
# When building with the memory sanitizer
33+
# E.g., bazel build --config msan
34+
build:msan --repo_env CC=clang
35+
build:msan --strip=never
36+
build:msan --copt -fsanitize=memory
37+
build:msan --copt -DADDRESS_SANITIZER
38+
build:msan --copt -g
39+
build:msan --copt -O3
40+
build:msan --copt -fno-omit-frame-pointer
41+
build:msan --linkopt -fsanitize=memory
42+
43+
# When building with the undefined behavior sanitizer
44+
# E.g., bazel build --config ubsan
45+
build:ubsan --repo_env CC=clang
46+
build:ubsan --strip=never
47+
build:ubsan --copt -fsanitize=undefined
48+
build:ubsan --copt -g
49+
build:ubsan --copt -O3
50+
build:ubsan --copt -fno-omit-frame-pointer
51+
build:ubsan --linkopt -fsanitize=undefined
52+
build:ubsan --linkopt -lubsan

.clang-format

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Run manually to reformat a file:
2+
# clang-format -i --style=file <file>
3+
BasedOnStyle: Google
4+
DerivePointerAlignment: false

.editorconfig

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Define the project's code formatting styles
2+
#
3+
# https://editorconfig.org
4+
#
5+
# EditorConfig is a file format for defining coding styles. EditorConfig is
6+
# natively supported by VisualStudio, GitHub, Neovim, etc.
7+
8+
[*]
9+
# Unix-style newlines and a newline ending in every file
10+
end_of_line = lf
11+
insert_final_newline = true
12+
13+
[*.{cc,h}]
14+
# https://google.github.io/styleguide/cppguide.html
15+
indent_style = space
16+
indent_size = 2
17+
18+
[*.py]
19+
# https://google.github.io/styleguide/pyguide.html but 2-space indent
20+
indent_style = space
21+
indent_size = 2
22+
23+
[WORKSPACE,BUILD,*.bzl]
24+
# https://bazel.build/build/style-guide
25+
indent_style = space
26+
indent_size = 4
27+
28+
[Makefile]
29+
indent_style = tab

.github/ci-error-template.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Failed CI Test
3+
labels: bug
4+
---
5+
There was a failed test in the CI pipeline for [PR {{ env.PR_NUM }}]({{ env.PR_LINK }}). Please see comments in the PR for more details.
6+
7+
This issue automatically generated for notification purposes.

.github/mergify.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
queue_rules:
2+
- name: default
3+
checks_timeout: 2 h
4+
conditions:
5+
- base=main
6+
- label=ci:ready_to_merge
7+
8+
9+
pull_request_rules:
10+
- name: push to default merge queue
11+
conditions:
12+
- base=main
13+
- label=ci:ready_to_merge
14+
actions:
15+
queue:
16+
name: default
17+
require_branch_protection: true
18+
method: squash
19+
commit_message_template: |
20+
{{ title }} (#{{ number }})
21+
{{ body_raw }}
22+
23+
- name: remove ci:ready_to_merge label
24+
conditions:
25+
- merged
26+
actions:
27+
label:
28+
remove:
29+
- ci:ready_to_merge

.github/scheduled-error-template.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Scheduled workflow failed
3+
labels: bug
4+
---
5+
{{ env.WORKFLOW }} run number {{ env.RUN_NUMBER }} failed. Please examine the run itself for more details.
6+
7+
This issue has been automatically generated for notification purposes.

.github/stale.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Number of days of inactivity before an Issue or Pull Request becomes stale
2+
daysUntilStale: 30
3+
# Number of days of inactivity before a stale Issue or Pull Request is closed
4+
daysUntilClose: 15
5+
# Comment to post when marking as stale. Set to `false` to disable
6+
markComment: >
7+
This issue has been automatically marked as stale because it has no
8+
recent activity. It will be closed if no further activity occurs. Thank you.
9+
# Comment to post when removing the stale label. Set to `false` to disable
10+
unmarkComment: false
11+
closeComment: >
12+
Closing as stale. Please reopen if you'd like to work on this further.
13+
limitPerRun: 30
14+
# Limit to only `issues` or `pulls`
15+
only: issues
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Check TfLite Files
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
trigger-sha:
7+
required: true
8+
type: string
9+
pr-number:
10+
required: true
11+
type: string
12+
pr-body:
13+
required: true
14+
type: string
15+
secrets:
16+
tflm-bot-token:
17+
required: true
18+
19+
jobs:
20+
check_tflite_files:
21+
runs-on: ubuntu-latest
22+
name: Check PR Modifies TfLite Files
23+
steps:
24+
- uses: actions/checkout@v2
25+
with:
26+
ref: ${{ inputs.trigger-sha }}
27+
28+
- name: Check Files
29+
if: ${{ !contains(inputs.pr-body, 'NO_CHECK_TFLITE_FILES=') }}
30+
run: |
31+
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ inputs.pr-number }}/files"
32+
PR_FILES=$(curl -s -X GET -H "Authorization: Bearer ${{ secrets.tflm-bot-token }}" $URL | jq -r '.[] | .filename')
33+
rm -rf tmp_pull_request_files.txt
34+
echo "${PR_FILES}" >> tmp_pull_request_files.txt
35+
rm -rf .git
36+
echo ${{ secrets.tflm-bot-token }} | docker login ghcr.io -u tflm-bot --password-stdin
37+
docker run --rm -v `pwd`:/tflite-micro -w /tflite-micro ghcr.io/tflm-bot/tflm-ci:latest python3 ci/check_tflite_files.py tmp_pull_request_files.txt
38+
TFLITE_FILE_TEST_STATUS=$?
39+
rm -f tmp_pull_request_files.txt
40+
exit ${TFLITE_FILE_TEST_STATUS}

0 commit comments

Comments
 (0)