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