add i2c scan command #2518
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build App | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
APP_NAME: ${{ github.event.repository.name }} | |
jobs: | |
refs: | |
name: Prepare CI Environment | |
runs-on: ubuntu-latest | |
outputs: | |
sha_short: ${{ steps.refs.outputs.sha_short }} | |
short_ref: ${{ steps.refs.outputs.short_ref }} | |
version: ${{ steps.refs.outputs.version }} | |
new_release: ${{ steps.refs.outputs.new_release }} | |
steps: | |
- name: Source checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Update SDKs if required | |
run: make update-submodules | |
- name: Semantic Release | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v3 | |
with: | |
dry_run: true | |
semantic_version: 19 | |
extra_plugins: | | |
@semantic-release/changelog | |
@semantic-release/git | |
conventional-changelog-conventionalcommits | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set outputs | |
id: refs | |
run: | | |
export BRANCH=${GITHUB_REF#refs/*/} | |
echo "branch: ${BRANCH}" | |
export BRANCHTRANSLATED=$(echo ${BRANCH} | tr '/' '_') | |
echo "short_ref: ${BRANCHTRANSLATED}" | |
export VERSION="" | |
if ${{ steps.semantic.outputs.new_release_published == 'true' }}; then | |
export VERSION=${{ steps.semantic.outputs.new_release_version }} | |
else | |
export VERSION=${BRANCHTRANSLATED}_$(git rev-parse --short=12 HEAD) | |
fi | |
echo "new_release: ${{ steps.semantic.outputs.new_release_published }}" | |
echo "version: ${VERSION}" | |
echo "::set-output name=new_release::${{ steps.semantic.outputs.new_release_published }}" | |
echo "::set-output name=short_ref::${BRANCHTRANSLATED}" | |
echo "::set-output name=sha_short::SHA-$(git rev-parse --short=12 HEAD)" | |
echo "::set-output name=version::${VERSION}" | |
build: | |
name: Build | |
needs: refs | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [OpenBK7231T, OpenBK7231N, OpenXR809, OpenBL602, OpenW800, OpenW600] | |
steps: | |
- name: Source checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
architecture: 'x64' | |
- name: Install dependencies | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get -y install libc6-i386 make | |
pip3 install pycryptodomex | |
pip3 install configobj | |
pip3 install toml | |
pip3 install fdt | |
- run: ls -la | |
- name: Run make | |
run: make APP_VERSION=${{ needs.refs.outputs.version }} APP_NAME=${{ matrix.platform }} ${{ matrix.platform }} | |
- name: Save build assets | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.APP_NAME }}_${{ needs.refs.outputs.version }} | |
path: | | |
output/${{ needs.refs.outputs.version }}/OpenBK7231T_UA_${{ needs.refs.outputs.version }}.bin | |
output/${{ needs.refs.outputs.version }}/OpenBK7231T_UG_${{ needs.refs.outputs.version }}.bin | |
output/${{ needs.refs.outputs.version }}/OpenBK7231T_QIO_${{ needs.refs.outputs.version }}.bin | |
output/${{ needs.refs.outputs.version }}/OpenBK7231N_QIO_${{ needs.refs.outputs.version }}.bin | |
output/${{ needs.refs.outputs.version }}/OpenBK7231N_UG_${{ needs.refs.outputs.version }}.bin | |
output/${{ needs.refs.outputs.version }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}.rbl | |
output/${{ needs.refs.outputs.version }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}.img | |
output/${{ needs.refs.outputs.version }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}.bin | |
output/${{ needs.refs.outputs.version }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}.fls | |
output/${{ needs.refs.outputs.version }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}_ota.img | |
output/${{ needs.refs.outputs.version }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}_gz.img | |
output/${{ needs.refs.outputs.version }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}_OTA.bin | |
output/${{ needs.refs.outputs.version }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}_OTA.bin.xz | |
output/${{ needs.refs.outputs.version }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}_OTA.bin.xz.ota | |
if-no-files-found: warn | |
release: | |
name: Semantic Release Images and Artifacts | |
runs-on: ubuntu-latest | |
needs: [ refs, build ] | |
if: always() && needs.refs.outputs.new_release == 'true' && (github.ref == 'refs/heads/main' || github.ref_name == 'alpha') | |
steps: | |
- name: Source checkout | |
uses: actions/checkout@v2 | |
- name: Fetch build assets | |
uses: actions/download-artifact@v2 | |
with: | |
name: ${{ env.APP_NAME }}_${{ needs.refs.outputs.version }} | |
path: output/${{ needs.refs.outputs.version }} | |
- name: Run Semantic Release | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v3 | |
with: | |
dry_run: false | |
semantic_version: 19 | |
extra_plugins: | | |
@semantic-release/changelog | |
@semantic-release/git | |
conventional-changelog-conventionalcommits | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Echo Semantic Release Versions | |
if: steps.semantic.outputs.new_release_published == 'true' | |
run: | | |
echo ${{ steps.semantic.outputs.new_release_version }} | |
echo ${{ steps.semantic.outputs.new_release_major_version }} | |
echo ${{ steps.semantic.outputs.new_release_minor_version }} | |
echo ${{ steps.semantic.outputs.new_release_patch_version }} |