Skip to content

[infra/onert] Add glibc-static installation for flatc build (#16133) #3

[infra/onert] Add glibc-static installation for flatc build (#16133)

[infra/onert] Add glibc-static installation for flatc build (#16133) #3

name: Run ONECC Ubuntu Build
on:
push:
branches:
- master
- release/*
paths:
- '.github/workflows/run-onecc-build.yml'
- 'nnas'
- 'nncc'
- 'compiler/**'
- 'infra/cmake/**'
- 'infra/nncc/**'
- 'nnpackage/schema/**'
- 'res/**'
- '!**/*.md'
pull_request:
branches:
- master
- release/*
paths:
- '.github/workflows/run-onecc-build.yml'
- 'nnas'
- 'nncc'
- 'compiler/**'
- 'infra/cmake/**'
- 'infra/nncc/**'
- 'nnpackage/schema/**'
- 'res/**'
- '!**/*.md'
defaults:
run:
shell: bash
# Cancel previous running jobs when pull request is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
prepare:
if: github.repository_owner == 'Samsung' && !contains(github.event.pull_request.labels.*.name, 'PR/NO TEST')
runs-on: ubuntu-latest
outputs:
run_matrix: ${{ steps.set-matrix.outputs.run_matrix }}
steps:
- name: set matrix
id: set-matrix
env:
EVENT_NAME: ${{ github.event_name }}
run: |
JSON='{'
if [[ "$EVENT_NAME" == "push" ]]; then
JSON+='"type": ["Debug"],'
JSON+='"ubuntu_code": ["jammy"]'
elif [[ "$EVENT_NAME" == "pull_request" ]]; then
JSON+='"type": ["Debug", "Release"],'
JSON+='"ubuntu_code": ["focal", "jammy", "noble"],'
JSON+='"exclude": [{"ubuntu_code": "focal", "type": "Debug"},'
JSON+='{"ubuntu_code": "noble", "type": "Debug"}]'
else
exit 1
fi
JSON+='}'
echo "run_matrix=$JSON" >> "$GITHUB_OUTPUT"
onecc-test:
needs: [ prepare ]
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.run_matrix) }}
runs-on: one-x64-linux
container:
image: samsungonedev.azurecr.io/nnfw/one-devtools:${{ matrix.ubuntu_code }}
options: --user root
env:
NNCC_WORKSPACE : build
NNCC_INSTALL_PREFIX : install
name: onecc ubuntu ${{ matrix.ubuntu_code }} ${{ matrix.type }} test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install onnx2circle
run: |
apt update
apt-get -qqy install software-properties-common
add-apt-repository ppa:circletools/nightly
apt-get -qqy install onnx2circle
- name: Install python3.10 for focal
if: matrix.ubuntu_code == 'focal'
run: |
add-apt-repository ppa:deadsnakes/ppa
apt-get -qqy install python3.10 python3.10-dev python3.10-venv
python3.10 -m ensurepip --upgrade
- name: Caching externals
uses: actions/cache@v4
with:
path: externals
key: external-onecc-${{ hashFiles('infra/cmake/packages/**/*.cmake') }}
restore-keys: |
external-onecc-
external-
- name: Caching overlay
uses: actions/cache@v4
with:
path: ${{ env.NNCC_WORKSPACE }}/overlay
key: overlay-onecc-${{ matrix.ubuntu_code }}-${{ hashFiles('compiler/common-artifacts/CMakeLists.txt') }}-${{ hashFiles('infra/cmake/packages/**/*.cmake') }}
- name: Build
run: |
./nncc configure -DENABLE_STRICT_BUILD=ON -DCMAKE_BUILD_TYPE=${{ matrix.type }} \
-DEXTERNALS_BUILD_THREADS="$(nproc)" -DCMAKE_INSTALL_PREFIX="${NNCC_INSTALL_PREFIX}"
./nncc build "-j$(nproc)"
cmake --build "${NNCC_WORKSPACE}" -- install
- name: Test(Debug)
if: matrix.type == 'Debug'
env:
LUCI_LOG : 100
run: ./nncc test
- name: Test(Release)
if: matrix.type == 'Release'
env:
NNCC_INSTALL_PATH : ${{ env.NNCC_WORKSPACE }}/${{ env.NNCC_INSTALL_PREFIX }}
run: |
./nncc test
"${NNCC_INSTALL_PATH}/bin/one-prepare-venv"
"${NNCC_INSTALL_PATH}/test/prepare_test_materials.sh"
export PATH=${PWD}/${NNCC_INSTALL_PATH}/bin:$PATH
pushd "${NNCC_INSTALL_PATH}/test"
## one-import-tf -> one-optimize -> one-quantize -> one-codegen
bash onecc_006.test
## one-import-tflite
bash onecc_014.test
## one-import-bcq
bash onecc_015.test
## one-import-onnx
bash onecc_016.test
## one-pack
bash onecc_019.test
## one-profile
bash onecc_021.test
## one-quantize
bash onecc_023.test
bash onecc_026.test
## one-infer
bash onecc_027.test
## onecc workflows
bash onecc_032.test
bash onecc_041.test
# Upload log if failed
- name: Upload log
uses: actions/upload-artifact@v4
if: failure()
env:
NNCC_INSTALL_PATH : ${{ env.NNCC_WORKSPACE }}/${{ env.NNCC_INSTALL_PREFIX }}
with:
name: fail-${{ matrix.ubuntu_code }}-${{ matrix.type }}
path: |
${{ env.NNCC_WORKSPACE }}/compiler/**/*.log
${{ env.NNCC_INSTALL_PATH }}/test/**/*.log