Merge pull request #478 from lesshonor/ci-buildall
refactor: build all CI workflow
This commit is contained in:
commit
0b5cd38568
102
.github/workflows/ci.yml
vendored
102
.github/workflows/ci.yml
vendored
@ -1,26 +1,102 @@
|
|||||||
name: CI
|
name: CI
|
||||||
|
on: [ pull_request, push, workflow_dispatch ]
|
||||||
|
|
||||||
on:
|
concurrency:
|
||||||
push:
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
||||||
workflow_dispatch:
|
cancel-in-progress: true
|
||||||
pull_request:
|
|
||||||
|
env:
|
||||||
|
REGEX_ANSI_COLOR: 's/\x1b\[[0-9;]*[mGKHF]//g'
|
||||||
|
REGEX_MAKE_OUTPUT: '/^g*make\[1]: \(Enter\|Leav\)ing directory ''/d'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
check-uid:
|
||||||
|
name: Check Vial UIDs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
container: qmkfm/qmk_cli
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: (actions) Checkout Vial repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Verify Vial UID is unique
|
- name: Verify Vial UID is unique per-keyboard
|
||||||
run: python3 util/ci_vial_verify_uid.py
|
run: python3 util/ci_vial_verify_uid.py
|
||||||
|
|
||||||
- name: Compile Vial keyboards
|
build-default:
|
||||||
|
name: Build default keymaps for Vial
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: ghcr.io/qmk/qmk_cli
|
||||||
|
env:
|
||||||
|
KEYMAP: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: (actions) Checkout Vial repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
id: build
|
||||||
run: |
|
run: |
|
||||||
git config --global --add safe.directory $(pwd)
|
git config --global --add safe.directory $(pwd)
|
||||||
make git-submodule
|
if ! qmk mass-compile -j $(nproc) $(qmk find -km vial | sed "s/:vial$/:${KEYMAP}/");
|
||||||
python3 util/ci_compile_vial_keyboards.py
|
then
|
||||||
|
echo "::error::$(ls -1 .build/failed.log.* | wc -l) keymaps failed to build. See logs and/or job summary for details."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Dump failure logs
|
||||||
|
if: ${{ failure() && steps.build.conclusion == 'failure' }}
|
||||||
|
run: |
|
||||||
|
echo '### Failure logs' | tee -a "${GITHUB_STEP_SUMMARY}"
|
||||||
|
|
||||||
|
cd .build || exit 1
|
||||||
|
for log in failed.log.*; do
|
||||||
|
pretty_logname="$(echo "${log}" | sed "s/^failed\.log\.[0-9]\+\.// ; s/\.${KEYMAP}$//")"
|
||||||
|
|
||||||
|
printf '\n::group::%s\n%s\n::endgroup::\n' "${pretty_logname}" "$(sed "${REGEX_MAKE_OUTPUT}" < "${log}")"
|
||||||
|
printf '\n<details>\n<summary>%s</summary>\n\n```\n%s\n```\n\n</details>\n' \
|
||||||
|
"${pretty_logname}" "$(sed "${REGEX_MAKE_OUTPUT} ; ${REGEX_ANSI_COLOR}" < "${log}")" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
|
done
|
||||||
|
|
||||||
|
build-vial:
|
||||||
|
name: Build Vial keymaps
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: ghcr.io/qmk/qmk_cli
|
||||||
|
env:
|
||||||
|
KEYMAP: vial
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: (actions) Checkout Vial repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
id: build
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory $(pwd)
|
||||||
|
if ! qmk mass-compile -km "${KEYMAP}" -j $(nproc);
|
||||||
|
then
|
||||||
|
echo "::error::$(ls -1 .build/failed.log.* | wc -l) keymaps failed to build. See logs and/or job summary for details."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Dump failure logs
|
||||||
|
if: ${{ failure() && steps.build.conclusion == 'failure' }}
|
||||||
|
run: |
|
||||||
|
echo '### Failure logs' | tee -a "${GITHUB_STEP_SUMMARY}"
|
||||||
|
|
||||||
|
cd .build || exit 1
|
||||||
|
for log in failed.log.*; do
|
||||||
|
pretty_logname="$(echo "${log}" | sed "s/^failed\.log\.[0-9]\+\.// ; s/\.${KEYMAP}$//")"
|
||||||
|
|
||||||
|
printf '\n::group::%s\n%s\n::endgroup::\n' "${pretty_logname}" "$(sed "${REGEX_MAKE_OUTPUT}" < "${log}")"
|
||||||
|
printf '\n<details>\n<summary>%s</summary>\n\n```\n%s\n```\n\n</details>\n' \
|
||||||
|
"${pretty_logname}" "$(sed "${REGEX_MAKE_OUTPUT} ; ${REGEX_ANSI_COLOR}" < "${log}")" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user