diff --git a/.github/workflows/qmk_userspace_build.yml b/.github/workflows/qmk_userspace_build.yml index 735e898c7ff..81b07a77924 100644 --- a/.github/workflows/qmk_userspace_build.yml +++ b/.github/workflows/qmk_userspace_build.yml @@ -30,21 +30,28 @@ jobs: path: userspace submodules: recursive - # This doesn't use actions/checkout as we want to allow qmk_firmware as a submodule + - name: Check qmk_firmware exists + id: check_files + uses: andstor/file-existence-action@v2 + with: + files: userspace/qmk_firmware + - name: Checkout QMK Firmware - run: | - if [ ! -d qmk_firmware ]; then - git clone -b ${{ inputs.qmk_ref || 'master' }} \ - --depth=1000 --recurse-submodules --shallow-submodules \ - https://github.com/${{ inputs.qmk_repo || 'qmk/qmk_firmware' }}.git - fi + uses: actions/checkout@v3 + if: steps.check_files.outputs.files_exists == 'false' + with: + path: userspace/qmk_firmware + repository: ${{ inputs.qmk_repo || 'qmk/qmk_firmware' }} + ref: ${{ inputs.qmk_ref || 'master' }} + submodules: recursive + fetch-depth: 1000 # This line should be removed once userspace support exists in QMK Firmware ######################################################## ## Delete this section once userspace exists upstream ## ######################################################## - name: Patch QMK Firmware with userspace support run: | - cd qmk_firmware + cd userspace/qmk_firmware git config --global user.email "nonexistent@email-address.invalid" git config --global user.name "QMK GitHub Actions User" git remote add qmk https://github.com/qmk/qmk_firmware.git @@ -55,19 +62,19 @@ jobs: - name: Install QMK CLI run: | python3 -m pip install --upgrade qmk - python3 -m pip install -r qmk_firmware/requirements.txt + python3 -m pip install -r userspace/qmk_firmware/requirements.txt - name: Configure QMK CLI run: | qmk config mass_compile.parallel=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) - qmk config user.qmk_home=$GITHUB_WORKSPACE/qmk_firmware + qmk config user.qmk_home=$GITHUB_WORKSPACE/userspace/qmk_firmware qmk config user.overlay_dir=$GITHUB_WORKSPACE/userspace - name: Build run: | qmk mass-compile -e DUMP_CI_METADATA=yes -km ${{ github.repository_owner }} || touch .failed # Generate the step summary markdown - ./qmk_firmware/util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true + ./userspace/qmk_firmware/util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true # Truncate to a maximum of 1MB to deal with GitHub workflow limit truncate --size='<960K' $GITHUB_STEP_SUMMARY || true # Exit with failure if the compilation stage failed