Skip to content

Commit

Permalink
[ci] add tf-frontend ci
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyunqu committed Jan 14, 2024
1 parent bbcbee2 commit 97bbc66
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/tf-frontend-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: TfFrontend CI

on:
push:
branches:
- main
paths:
- ".github/workflows/tf-frontend-ci.yaml"
- "frontends/tf-frontend/**"
- "!**/**.md"
pull_request:
branches:
- main
paths:
- ".github/workflows/tf-frontend-ci.yaml"
- "frontends/tf-frontend/**"
- "!**/**.md"
workflow_dispatch:

# Ensure that only a single job or workflow using the same
# concurrency group will run at a time. This would cancel
# any in-progress jobs in the same github workflow and github
# ref (e.g. refs/heads/main or refs/pull/<pr_number>/merge).
concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
# queued and in-progress runs for the same PR (presubmit) or commit
# (postsubmit). The workflow name is prepended to avoid conflicts between
# different workflows.
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
tf_frontend_build_and_test:
name: tf-frontend CI
runs-on: self-hosted
steps:
- name: clear workspace
run: rm -rf $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
- name: Checkout byteir repo
uses: actions/checkout@v3
- name: Build and test TfFrontend
run: TF_PYTHON_VERSION=3.9 ./frontends/tf-frontend/scripts/build_and_test.sh
shell: bash
1 change: 1 addition & 0 deletions frontends/tf-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cd frontends/tf-frontend
# build:
./bazel build //tools:tf-frontend //tools:tf-ext-opt
# test:
export TF_PYTHON_VERSION=3.9 # change this to python version which installed lit
./bazel test //tf_mlir_ext/tests:all
```

Expand Down
16 changes: 16 additions & 0 deletions frontends/tf-frontend/scripts/build_and_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e
set -x

CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# path to byteir/frontends/tf-frontend
PROJ_DIR="$CUR_DIR/.."

bash $PROJ_DIR/scripts/prepare.sh

pushd $PROJ_DIR
$PROJ_DIR/bazel --output_user_root=./build build //tools:tf-frontend //tools:tf-ext-opt
$PROJ_DIR/bazel --output_user_root=./build test //tf_mlir_ext/tests:all --java_runtime_version=remotejdk_11
$PROJ_DIR/bazel --output_user_root=./build test //tf_mlir_ext/numerical:all --java_runtime_version=remotejdk_11
popd

0 comments on commit 97bbc66

Please sign in to comment.