2023-03-09 23:36:20 +01:00
|
|
|
name: CI Builds
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
on:
|
2023-03-29 03:51:39 +02:00
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0,12 * * *'
|
2023-03-09 23:36:20 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
ci_builds:
|
2023-03-12 02:55:26 +01:00
|
|
|
name: "CI Build"
|
2023-03-09 23:36:20 +01:00
|
|
|
runs-on: self-hosted
|
2023-03-12 02:18:49 +01:00
|
|
|
timeout-minutes: 1380
|
2023-03-09 23:36:20 +01:00
|
|
|
|
|
|
|
if: github.repository == 'qmk/qmk_firmware'
|
|
|
|
|
|
|
|
strategy:
|
2023-03-29 03:51:39 +02:00
|
|
|
fail-fast: false
|
2023-03-09 23:36:20 +01:00
|
|
|
matrix:
|
2023-03-29 03:51:39 +02:00
|
|
|
branch: [master, develop]
|
2023-03-14 22:31:10 +01:00
|
|
|
keymap: [default, via]
|
2023-03-09 23:36:20 +01:00
|
|
|
|
2023-03-17 02:32:09 +01:00
|
|
|
container: ghcr.io/qmk/qmk_cli
|
2023-03-09 23:36:20 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Disable safe.directory check
|
|
|
|
run : git config --global --add safe.directory '*'
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2023-03-29 03:51:39 +02:00
|
|
|
ref: ${{ matrix.branch }}
|
2023-03-09 23:36:20 +01:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip3 install -r requirements.txt
|
|
|
|
|
2023-03-18 16:58:51 +01:00
|
|
|
- name: Run `qmk mass-compile` (keymap ${{ matrix.keymap }})
|
2023-03-29 03:51:39 +02:00
|
|
|
run: |
|
|
|
|
export NCPUS=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
|
2023-03-29 07:48:57 +02:00
|
|
|
qmk mass-compile -t -j $NCPUS -km ${{ matrix.keymap }} -e DUMP_CI_METADATA=yes || touch .failed
|
2023-03-29 06:55:31 +02:00
|
|
|
# Generate the step summary markdown
|
2023-03-29 07:48:57 +02:00
|
|
|
./util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true
|
2023-03-29 06:55:31 +02:00
|
|
|
# Truncate to a maximum of 1MB to deal with GitHub workflow limit
|
2023-03-29 07:48:57 +02:00
|
|
|
truncate --size='<960K' $GITHUB_STEP_SUMMARY || true
|
|
|
|
# Exit with failure if the compilation stage failed
|
|
|
|
[ ! -f .failed ] || exit 1
|
2023-03-14 22:31:10 +01:00
|
|
|
|
2023-03-29 03:51:39 +02:00
|
|
|
- name: 'Upload artifacts'
|
2023-03-14 22:31:10 +01:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-03-29 03:51:39 +02:00
|
|
|
if: always()
|
2023-03-14 22:31:10 +01:00
|
|
|
with:
|
2023-03-29 03:51:39 +02:00
|
|
|
name: artifacts-${{ matrix.branch }}-${{ matrix.keymap }}
|
2023-03-14 22:31:10 +01:00
|
|
|
if-no-files-found: ignore
|
|
|
|
path: |
|
|
|
|
*.bin
|
|
|
|
*.hex
|
|
|
|
*.uf2
|
2023-03-29 03:51:39 +02:00
|
|
|
.build/failed.*
|