logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

ci_build_major_branch.yml (4802B)


  1. name: CI Build Major Branch
  2. permissions:
  3. contents: read
  4. actions: write
  5. on:
  6. push:
  7. branches: [master, develop]
  8. workflow_dispatch:
  9. inputs:
  10. branch:
  11. type: choice
  12. description: "Branch to build"
  13. options: [master, develop]
  14. env:
  15. # https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits
  16. # We've decreased it from 20 to 15 to allow for other GHA to run unimpeded
  17. CONCURRENT_JOBS: 15
  18. # Ensure we only have one build running at a time, cancelling any active builds if a new commit is pushed to the respective branch
  19. concurrency:
  20. group: ci_build-${{ github.event.inputs.branch || github.ref_name }}
  21. cancel-in-progress: true
  22. jobs:
  23. determine_concurrency:
  24. name: "Determine concurrency"
  25. if: github.repository == 'qmk/qmk_firmware'
  26. runs-on: ubuntu-latest
  27. container: ghcr.io/qmk/qmk_cli
  28. outputs:
  29. slice_length: ${{ steps.generate_slice_length.outputs.slice_length }}
  30. steps:
  31. - name: Install prerequisites
  32. run: |
  33. apt-get update
  34. apt-get install -y jq
  35. - name: Disable safe.directory check
  36. run: |
  37. git config --global --add safe.directory '*'
  38. - name: Checkout QMK Firmware
  39. uses: actions/checkout@v4
  40. - name: Determine concurrency
  41. id: generate_slice_length
  42. run: |
  43. target_count=$( {
  44. qmk find -km default 2>/dev/null
  45. # qmk find -km xap 2>/dev/null
  46. } | sort | uniq | wc -l)
  47. slice_length=$((target_count / ($CONCURRENT_JOBS - 1))) # Err on the side of caution
  48. echo "slice_length=$slice_length" >> $GITHUB_OUTPUT
  49. build_targets:
  50. name: "Compile keymap ${{ matrix.keymap }}"
  51. needs: determine_concurrency
  52. strategy:
  53. fail-fast: false
  54. matrix:
  55. keymap: [default]
  56. # keymap: [default, xap]
  57. uses: ./.github/workflows/ci_build_major_branch_keymap.yml
  58. with:
  59. branch: ${{ inputs.branch || github.ref_name }}
  60. keymap: ${{ matrix.keymap }}
  61. slice_length: ${{ needs.determine_concurrency.outputs.slice_length }}
  62. secrets: inherit
  63. rollup_tasks:
  64. name: "Consolidation"
  65. needs: build_targets
  66. runs-on: ubuntu-latest
  67. steps:
  68. - name: Disable safe.directory check
  69. run: |
  70. git config --global --add safe.directory '*'
  71. - name: Checkout QMK Firmware
  72. uses: actions/checkout@v4
  73. with:
  74. fetch-depth: 0
  75. - name: Download firmwares
  76. uses: actions/download-artifact@v5
  77. with:
  78. pattern: firmware-*
  79. path: .
  80. merge-multiple: true
  81. - name: Generate index page
  82. run: |
  83. python3 -m pip install -r ./util/ci/requirements.txt
  84. ./util/ci/index_generator.py > index.html
  85. ./util/ci/firmware_list_generator.py > firmware_list.json
  86. - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/${{ github.sha }}
  87. uses: jakejarvis/s3-sync-action@master
  88. with:
  89. args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include 'firmware_list.json' --include '*.hex' --include '*.bin' --include '*.uf2'
  90. env:
  91. AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }}
  92. AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }}
  93. AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_QMK_FM_SPACES_SECRET }}
  94. AWS_REGION: ${{ vars.CI_QMK_FM_SPACES_REGION }}
  95. AWS_S3_ENDPOINT: ${{ vars.CI_QMK_FM_SPACES_ENDPOINT }}
  96. SOURCE_DIR: .
  97. DEST_DIR: ${{ inputs.branch || github.ref_name }}/${{ github.sha }}
  98. - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/latest
  99. uses: jakejarvis/s3-sync-action@master
  100. with:
  101. args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include 'firmware_list.json' --include '*.hex' --include '*.bin' --include '*.uf2'
  102. env:
  103. AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }}
  104. AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }}
  105. AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_QMK_FM_SPACES_SECRET }}
  106. AWS_REGION: ${{ vars.CI_QMK_FM_SPACES_REGION }}
  107. AWS_S3_ENDPOINT: ${{ vars.CI_QMK_FM_SPACES_ENDPOINT }}
  108. SOURCE_DIR: .
  109. DEST_DIR: ${{ inputs.branch || github.ref_name }}/latest
  110. - name: Check if failure marker file exists
  111. id: check_failure_marker
  112. uses: andstor/file-existence-action@v3
  113. with:
  114. files: ./.failed
  115. - name: Fail build if needed
  116. if: steps.check_failure_marker.outputs.files_exists == 'true'
  117. run: |
  118. # Exit with failure if the compilation stage failed
  119. exit 1