Update BuiltTest.yml [skip actions]

This commit is contained in:
Sebastien L
2022-10-06 12:44:19 -04:00
parent 2698577592
commit 5a53011383

View File

@@ -3,11 +3,11 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
ui_build: ui_build:
description: 'Rebuild UI' description: 'Force Rebuilding the UI. When not forced, the system will check for [ui-build] in the last commit message to trigger a ui rebuild'
required: true required: true
type: boolean type: boolean
release_build: release_build:
description: 'Release' description: 'Force a Release build. When not forced, the system will check for release word in the last commit message to trigger a release'
required: true required: true
type: boolean type: boolean
# push: # push:
@@ -26,16 +26,6 @@ jobs:
release_flag: ${{ steps.build_flags.outputs.release_flag }} release_flag: ${{ steps.build_flags.outputs.release_flag }}
mock: ${{ steps.build_flags.outputs.mock }} mock: ${{ steps.build_flags.outputs.mock }}
steps: steps:
- name: Force UI Rebuild if selected
if: ${{ inputs.ui_build }}
run: |
echo "Workflow dispatched with ui rebuild option selected"
echo "ui_build_option='--ui_build'" >> $GITHUB_ENV
- name: Force Release if selected
if: ${{ inputs.release_build }}
run: |
echo "Workflow dispatched with release build option selected"
echo "release_build_option='--force'" >> $GITHUB_ENV
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -49,6 +39,10 @@ jobs:
id: build_flags id: build_flags
run: | run: |
git config --global --add safe.directory /__w/squeezelite-esp32/squeezelite-esp32 git config --global --add safe.directory /__w/squeezelite-esp32/squeezelite-esp32
[ ${{github.event.inputs.ui_build}} ] && ui_build_option="--ui_build" || ui_build_option=""
[ ${{github.event.inputs.release_build}} ] && release_build_option="--force" || release_build_option=""
echo "ui_build_option=$ui_build_option" >> $GITHUB_ENV
echo "release_build_option=$release_build_option" >> $GITHUB_ENV
echo "Dumping environment" echo "Dumping environment"
env env
. /opt/esp/python_env/idf4.3_py3.8_env/bin/activate . /opt/esp/python_env/idf4.3_py3.8_env/bin/activate
@@ -56,26 +50,15 @@ jobs:
# --mock - to mock the compilation part - this is to be used for testing only # --mock - to mock the compilation part - this is to be used for testing only
# --force - to force a release build even if the last commit message doesn't contain the word "release" # --force - to force a release build even if the last commit message doesn't contain the word "release"
# --ui_build - to force a ui_build even if the last commit message doesn't contain "[ui-build]" # --ui_build - to force a ui_build even if the last commit message doesn't contain "[ui-build]"
build_tools.py build_flags ${{ env.ui_build_option }} ${{ env.release_build_option }} build_tools.py build_flags $ui_build_option $release_build_option
preparation:
name: Preparation
needs: bootstrap
runs-on: ubuntu-latest
container:
image: sle118/squeezelite-esp32-idfv43
steps:
- name: Show Build Flags - name: Show Build Flags
run: | run: |
echo "Running with the following options" echo "Running with the following options"
echo "Web Build Flag=${{needs.bootstrap.outputs.ui_build}}" echo "Web Build Flag=${{steps.build_flags.outputs.ui_build}}"
echo "Mock flag=${{needs.bootstrap.outputs.mock}}" echo "Mock flag=${{steps.build_flags.outputs.mock}}"
echo "Release Flag=${{needs.bootstrap.outputs.release_flag}}" echo "Release Flag=${{steps.build_flags.outputs.release_flag}}"
git config --global --add safe.directory /__w/squeezelite-esp32/squeezelite-esp32
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Refresh certificates - name: Refresh certificates
if: ${{ steps.build_flags.outputs.release_flag }}
run: | run: |
git update-index --chmod=+x ./server_certs/getcert.sh git update-index --chmod=+x ./server_certs/getcert.sh
cd server_certs;./getcert.sh;cat github.pem;cd .. cd server_certs;./getcert.sh;cat github.pem;cd ..
@@ -87,13 +70,13 @@ jobs:
cache: 'npm' cache: 'npm'
cache-dependency-path: components/wifi-manager/webapp/package.json cache-dependency-path: components/wifi-manager/webapp/package.json
- name: Build Web Application - name: Build Web Application
if: ${{ needs.bootstrap.outputs.ui_build == 1 }} if: ${{ steps.build_flags.outputs.ui_build == 1 }}
run: | run: |
cd components/wifi-manager/webapp/ cd components/wifi-manager/webapp/
npm install npm install
npm run-script build npm run-script build
- name: Update repository with prebuilt items - name: Update repository with prebuilt items
if: ${{ needs.bootstrap.outputs.ui_build == 1 || needs.bootstrap.outputs.release_flag == 1 }} if: ${{ steps.build_flags.outputs.ui_build == 1 || build_flags.outputs.release_flag == 1 }}
run: | run: |
git config user.name github-actions git config user.name github-actions
git config user.email github-actions@github.com git config user.email github-actions@github.com
@@ -118,7 +101,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: sle118/squeezelite-esp32-idfv43 image: sle118/squeezelite-esp32-idfv43
needs: [preparation,bootstrap] needs: [bootstrap]
strategy: strategy:
matrix: matrix:
node: [I2S-4MFlash, SqueezeAmp, Muse] node: [I2S-4MFlash, SqueezeAmp, Muse]
@@ -192,7 +175,7 @@ jobs:
zip -r build_output.zip build zip -r build_output.zip build
zip build/${artifact_file_name} partitions*.csv components/ build/*.bin build/bootloader/bootloader.bin build/partition_table/partition-table.bin build/flash_project_args build/size_*.txt zip build/${artifact_file_name} partitions*.csv components/ build/*.bin build/bootloader/bootloader.bin build/partition_table/partition-table.bin build/flash_project_args build/size_*.txt
fi fi
- name: Upload Artifacts - name: Upload Build Artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
if: ${{ needs.bootstrap.outputs.mock == 0 }} if: ${{ needs.bootstrap.outputs.mock == 0 }}
with: with:
@@ -204,8 +187,11 @@ jobs:
partitions.csv partitions.csv
sdkconfig sdkconfig
server_certs/github.pem server_certs/github.pem
build/*.bin
build/bootloader/bootloader.bin
build/partition_table/partition-table.bin
build_output.zip build_output.zip
- name: Save Last Build - name: Save Last Build Parameters
if: ${{ needs.bootstrap.outputs.mock == 0 }} if: ${{ needs.bootstrap.outputs.mock == 0 }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@@ -252,7 +238,7 @@ jobs:
update_web_installer: update_web_installer:
name: Web Installer name: Web Installer
if: ${{ needs.bootstrap.outputs.release_flag == 1 && needs.bootstrap.outputs.mock == 0 }} if: ${{ needs.bootstrap.outputs.release_flag == 1 && needs.bootstrap.outputs.mock == 0 }}
needs: [build, preparation,bootstrap] needs: [build, bootstrap]
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: sle118/squeezelite-esp32-idfv43 image: sle118/squeezelite-esp32-idfv43