Skip to content

Correct typos in hal_wifi.c #634

Correct typos in hal_wifi.c

Correct typos in hal_wifi.c #634

Workflow file for this run

name: Build CRB
on:
pull_request:
branches:
- main
- dev
env:
PULL_REQUEST_ID: ${{ github.event.number }}
CI_ROOT: /data/k510/github-actions
TFTP_ROOT: /data/tftp_server
NFS_ROOT: /data/nfs_server
defaults:
run:
shell: bash
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build_image:
name: Build
runs-on: [self-hosted, k510_buildroot]
timeout-minutes: 45
container:
image: ai.b-bug.org:5000/k510_sdk_github
env:
CONF: k510_${{ matrix.cfg }}_defconfig
ENV: pull-request
volumes:
- /data:/data
options: --hostname pull-request
strategy:
matrix:
cfg: ["crb_lp3_v1_2"]
outputs:
md5_bbl: ${{ steps.save_tftp.outputs.md5_bbl }}
md5_dtb: ${{ steps.save_tftp.outputs.md5_dtb }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
clean: false
- name: Install toolchain
id: install_toolchain
run: |
test -f toolchain/nds64le-linux-glibc-v5d.txz || wget -c https://ai.b-bug.org/k510/toolchain/nds64le-linux-glibc-v5d.txz -O toolchain/nds64le-linux-glibc-v5d.txz
test -f toolchain/nds64le-elf-mculib-v5d.txz || wget -c https://ai.b-bug.org/k510/toolchain/nds64le-elf-mculib-v5d.txz -O toolchain/nds64le-elf-mculib-v5d.txz
- name: Download cache package
id: download_cache
run: |
test -f pkg-download/dl.tar.gz && rm pkg-download/dl.tar.gz
wget -qc https://ai.b-bug.org/k510/downloads/pkg-download/dl.tar.gz -O pkg-download/dl.tar.gz
echo "dl.tar.gz file md5 check"
md5sum pkg-download/dl.tar.gz
test -d dl_bak && rm -rf dl_bak
test -d dl && mv dl dl_bak
tar -xf pkg-download/dl.tar.gz
test -d dl/ai/ || mkdir -p dl/ai/
wget -qc https://ai.b-bug.org/k510/downloads/pkg-download/ai_kmodel_data.tar.xz -O dl/ai/ai_kmodel_data.tar.xz
echo "ai_kmodel_data.tar.xz file md5 check"
md5sum dl/ai/ai_kmodel_data.tar.xz
test -d dl/riscv-pk-k510 && (test -d dl/riscv-pk-k510 || mv dl_bak/riscv-pk-k510 dl/)
test -d dl_bak && rm -rf dl_bak
- name: Build image
id: build_image
run: |
sed -i "s/BR2_JLEVEL=5/BR2_JLEVEL=14/g" configs/$CONF
rm -rf $CONF
rm -rf buildroot-*
make CONF=$CONF
- name: Save image to CI cache
id: save_cache
run: |
export HW=`echo ${{ matrix.cfg }}|awk -F '_' '{print $1"_"$3"."$4}'`
echo $HW
VER=$(cat $CONF/target/etc/version/release_version | grep ".*CST-github-pull-request" | sed 's/\(.*\)CST-github-pull-request/\1/g') || exit 1
echo $VER
mkdir -p $CI_ROOT/$VER/$HW/
cp -r --sparse=always $CONF/images/* $CI_ROOT/$VER/$HW/
cp -r --sparse=always $CONF/target/etc/version/release_version $CI_ROOT/$VER/$HW/
test -d $CI_ROOT/latest && rm $CI_ROOT/latest
ln -s -f $CI_ROOT/$VER $CI_ROOT/latest
- name: Save image to TFTP
id: save_tftp
run: |
export HW=`echo ${{ matrix.cfg }}|awk -F '_' '{print $1"_"$3"."$4}'`
export SAVE_DIR=$TFTP_ROOT/k510/$HW/$PULL_REQUEST_ID"_"$GITHUB_RUN_ID
echo $HW
echo $SAVE_DIR
mkdir -p $SAVE_DIR/
cp --sparse=always $CONF/images/bootm-bbl.img $SAVE_DIR/bootm-bbl.img
cp --sparse=always $CONF/images/k510.dtb $SAVE_DIR/k510.dtb
md5_bbl=$(md5sum $SAVE_DIR/bootm-bbl.img | awk '{print $1}')
md5_dtb=$(md5sum $SAVE_DIR/k510.dtb | awk '{print $1}')
echo $md5_bbl
echo $md5_dtb
echo "md5_bbl=$md5_bbl" >> $GITHUB_OUTPUT
echo "md5_dtb=$md5_dtb" >> $GITHUB_OUTPUT
- name: Save image to NFS
id: save_nfs
run: |
export HW=`echo ${{ matrix.cfg }}|awk -F '_' '{print $1"_"$3"."$4}'`
export SAVE_DIR=$NFS_ROOT/k510/$HW/$PULL_REQUEST_ID"_"$GITHUB_RUN_ID
echo $HW
echo $SAVE_DIR
mkdir -p $SAVE_DIR/
tar -xf $CONF/images/rootfs.tar -C $SAVE_DIR/
test_image:
name: Test
needs: build_image
timeout-minutes: 15
runs-on: [self-hosted, k510_buildroot]
container:
image: ai.b-bug.org:5000/k510_sdk_github
volumes:
- /data:/data
strategy:
matrix:
cfg: ["crb_lp3_v1_2"]
steps:
- name: Get Available DUT
id: get_dut
run: |
echo "Get Available DUT start"
export HW_MODEL=`echo ${{ matrix.cfg }}|awk -F '_' '{print $1}'`
export HW_VER=`echo ${{ matrix.cfg }}|awk -F '_' '{print $3"."$4}'`
test -d bin || mkdir ./bin
test -f ./bin/ailab && rm -rf ./bin/ailab
wget -qc https://ai.b-bug.org/k510/downloads/github/ailab -O ./bin/ailab
chmod +x ./bin/ailab
available=$(./bin/ailab show --dest available --hw_type k510 --hw_model $HW_MODEL --hw_ver $HW_VER --format args)
echo $available
echo "available=$available" >> $GITHUB_ENV
if [[ $available =~ "k510" ]]; then
echo "Get Available DUT pass"
else
echo "ERROR: No Available DUT, Please rerun to check it again"
exit 1
fi
- name: Reserve DUT
id: reserve_dut
run: |
echo "Reserve DUT start"
echo "PR ID: $PULL_REQUEST_ID"
echo "Job ID: $GITHUB_RUN_ID"
reserved=$(./bin/ailab add ${{ env.available }} --time 15m --site github-actions --source $PULL_REQUEST_ID --job $GITHUB_RUN_ID --format args)
echo $reserved
echo "reserved=$reserved" >> $GITHUB_ENV
if [[ $reserved =~ "github-actions" ]]; then
echo "Reserve DUT pass"
else
echo "ERROR: Reserve DUT failed"
exit 1
fi
power=$(./bin/ailab power --type=on ${{ env.available }})
echo $power
if [[ $power =~ "True" ]]; then
echo "Power on DUT pass"
else
echo "ERROR: Power on DUT failed"
exit 1
fi
- name: Load Image
id: load_image
timeout-minutes: 5
run: |
echo "Load image start"
echo "bbl md5: ${{needs.build_image.outputs.md5_bbl}}"
echo "dtb md5: ${{needs.build_image.outputs.md5_dtb}}"
test -d bin || mkdir ./bin
test -f ./bin/aiload && rm -rf ./bin/aiload
wget -qc https://ai.b-bug.org/k510/downloads/github/aiload -O ./bin/aiload
chmod +x ./bin/aiload
echo $PULL_REQUEST_ID
echo $GITHUB_RUN_ID
./bin/aiload --pr_id $PULL_REQUEST_ID --job_id $GITHUB_RUN_ID --md5_dtb ${{needs.build_image.outputs.md5_dtb}} --md5_bbl ${{needs.build_image.outputs.md5_bbl}} ${{ env.available }}
- name: Run Test
id: run_test
timeout-minutes: 10
run: |
echo "Run Test start"
test -d bin || mkdir ./bin
test -f ./bin/airobot && rm -rf ./bin/airobot
wget -qc https://ai.b-bug.org/k510/downloads/github/airobot -O ./bin/airobot
chmod +x ./bin/airobot
test -f ./k510.robot && rm -rf ./k510.robot
wget -qc https://ai.b-bug.org/k510/downloads/github/k510.robot -O ./k510.robot
./bin/ailab convert --dest=script --format yaml --file_name=var.yml ${{ env.available }}
test -f var.yml || exit 1
echo "Run test case start"
./bin/airobot -m github -V var.yml -i github k510.robot
echo "Run test case pass"
- name: Release DUT
id: release_dut
if: ${{ always() }}
run: |
echo "Release DUT start"
test -d bin || mkdir ./bin
result=$(./bin/ailab update ${{ env.reserved }})
echo $result
if [[ $result =~ "True" ]]; then
echo "Release DUT pass"
else
echo "ERROR: Release DUT failed"
exit 1
fi
power=$(./bin/ailab power --type=off ${{ env.available }})
echo $power
if [[ $power =~ "True" ]]; then
echo "Power off DUT pass"
else
echo "ERROR: Power off DUT failed"
exit 1
fi