You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.3 KiB

  1. name: CI Builds
  2. permissions:
  3. contents: read
  4. on:
  5. push:
  6. branches: [master, develop]
  7. workflow_dispatch:
  8. inputs:
  9. branch:
  10. type: choice
  11. description: 'Branch to build'
  12. options: [master, develop]
  13. concurrency: ci_build-${{ github.event.inputs.branch || github.ref_name }}
  14. jobs:
  15. ci_builds:
  16. if: github.repository == 'qmk/qmk_firmware'
  17. name: "CI Build"
  18. runs-on: self-hosted
  19. timeout-minutes: 1380
  20. strategy:
  21. fail-fast: false
  22. matrix:
  23. keymap: [default, via]
  24. container: ghcr.io/qmk/qmk_cli
  25. steps:
  26. - name: Disable safe.directory check
  27. run : git config --global --add safe.directory '*'
  28. - uses: actions/checkout@v4
  29. with:
  30. submodules: recursive
  31. ref: ${{ github.event.inputs.branch || github.ref }}
  32. - name: Install dependencies
  33. run: pip3 install -r requirements.txt
  34. - name: Run `qmk mass-compile` (keymap ${{ matrix.keymap }})
  35. run: |
  36. export NCPUS=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
  37. qmk mass-compile -t -j $NCPUS -km ${{ matrix.keymap }} -e DUMP_CI_METADATA=yes || touch .failed
  38. # Generate the step summary markdown
  39. ./util/ci/generate_failure_markdown.sh > $GITHUB_STEP_SUMMARY || true
  40. # Truncate to a maximum of 1MB to deal with GitHub workflow limit
  41. truncate --size='<960K' $GITHUB_STEP_SUMMARY || true
  42. # Exit with failure if the compilation stage failed
  43. [ ! -f .failed ] || exit 1
  44. - name: 'Upload artifacts'
  45. uses: actions/upload-artifact@v3
  46. if: always()
  47. with:
  48. name: artifacts-${{ github.event.inputs.branch || github.ref_name }}-${{ matrix.keymap }}
  49. if-no-files-found: ignore
  50. path: |
  51. *.bin
  52. *.hex
  53. *.uf2
  54. .build/failed.*
  55. - name: 'CI Discord Notification'
  56. if: always()
  57. working-directory: util/ci/
  58. env:
  59. DISCORD_WEBHOOK: ${{ secrets.CI_DISCORD_WEBHOOK }}
  60. run: |
  61. python3 -m pip install -r requirements.txt
  62. 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 }}