From c7f10dc409dd9a27cb72035116212f4b8971c554 Mon Sep 17 00:00:00 2001 From: Yomi Ikuru Date: Sun, 3 Dec 2023 22:26:09 +0000 Subject: [PATCH] chore: Update GitHub action --- .github/workflows/build.yml | 115 +----------------------------------- 1 file changed, 1 insertion(+), 114 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4943b1..d74fb89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,118 +1,5 @@ on: [push, pull_request, workflow_dispatch] -name: Build - jobs: - matrix: - runs-on: ubuntu-latest - name: Fetch Build Keyboards - outputs: - build_matrix: ${{ env.build_matrix }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install yaml2json - run: python3 -m pip install remarshal - - - name: Fetch Build Matrix - run: | - echo "build_matrix=$(yaml2json '${{ inputs.build_matrix_path }}' | jq -c .)" >> $GITHUB_ENV - yaml2json "${{ inputs.build_matrix_path }}" | jq - build: - runs-on: ubuntu-latest - container: - image: zmkfirmware/zmk-build-arm:stable - needs: matrix - name: Build - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.matrix.outputs.build_matrix) }} - steps: - - name: Prepare variables - shell: sh -x {0} - env: - board: ${{ matrix.board }} - shield: ${{ matrix.shield }} - artifact_name: ${{ matrix.artifact-name }} - run: | - echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV - echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}" >> $GITHUB_ENV - echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV - echo "artifact_name=${artifact_name:-${shield:+$shield-}${board}-zmk}" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@v3 - - - name: Cache west modules - uses: actions/cache@v3.0.11 - continue-on-error: true - env: - cache_name: cache-zephyr-${{ env.zephyr_version }}-modules - with: - path: | - modules/ - tools/ - zephyr/ - bootloader/ - zmk/ - key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache_name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: West Init - run: west init -l "${{ inputs.config_path }}" - - - name: West Update - run: west update - - - name: West Zephyr export - run: west zephyr-export - - - name: West Build (${{ env.display_name }}) - shell: sh -x {0} - run: west build -s zmk/app -b "${{ matrix.board }}" -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/${{ inputs.config_path }}" ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }} - - - name: ${{ env.display_name }} Kconfig file - run: | - if [ -f build/zephyr/.config ] - then - grep -v -e "^#" -e "^$" build/zephyr/.config | sort - else - echo "No Kconfig output" - fi - if: ${{ !cancelled() }} - - - name: ${{ env.display_name }} Devicetree file - run: | - if [ -f build/zephyr/zephyr.dts ] - then - cat build/zephyr/zephyr.dts - elif [ -f build/zephyr/zephyr.dts.pre ] - then - cat -s build/zephyr/zephyr.dts.pre - else - echo "No Devicetree output" - fi - if: ${{ !cancelled() }} - - - name: Rename artifacts - shell: sh -x {0} - run: | - mkdir build/artifacts - if [ -f build/zephyr/zmk.uf2 ] - then - cp build/zephyr/zmk.uf2 "build/artifacts/${{ env.artifact_name }}.uf2" - elif [ -f build/zephyr/zmk.${{ inputs.fallback_binary }} ] - then - cp "build/zephyr/zmk.${{ inputs.fallback_binary }}" "build/artifacts/${{ env.artifact_name }}.${{ inputs.fallback_binary }}" - fi - - - name: Archive (${{ env.display_name }}) - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.archive_name }} - path: build/artifacts + uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main