ci.yml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. name: CI
  2. on: [push, pull_request]
  3. env:
  4. CI: 'true'
  5. ASAN_OPTIONS: detect_leaks=0
  6. LC_ALL: en_US.UTF-8
  7. LANG: en_US.UTF-8
  8. permissions:
  9. contents: read # to fetch code (actions/checkout)
  10. jobs:
  11. linux:
  12. name: Linux (python=${{ matrix.pyver }} cc=${{ matrix.cc }} sanitize=${{ matrix.sanitize }})
  13. runs-on: ubuntu-latest
  14. env:
  15. CC: ${{ matrix.cc }}
  16. KITTY_SANITIZE: ${{ matrix.sanitize }}
  17. strategy:
  18. matrix:
  19. python: [a, b, c]
  20. cc: [gcc, clang]
  21. include:
  22. - python: a
  23. pyver: "3.9"
  24. sanitize: 0
  25. - python: b
  26. pyver: "3.10"
  27. sanitize: 1
  28. - python: c
  29. pyver: "3.11"
  30. sanitize: 1
  31. exclude:
  32. - python: a
  33. cc: clang
  34. - python: b
  35. cc: clang
  36. - python: c
  37. cc: gcc
  38. steps:
  39. - name: Checkout source code
  40. uses: actions/checkout@v3
  41. with:
  42. fetch-depth: 10
  43. - name: Set up Python ${{ matrix.pyver }}
  44. uses: actions/setup-python@v4
  45. with:
  46. python-version: ${{ matrix.pyver }}
  47. - name: Install Go
  48. uses: actions/setup-go@v4
  49. with:
  50. go-version-file: go.mod
  51. - name: Build kitty
  52. run: python .github/workflows/ci.py build
  53. - name: Test kitty
  54. run: python .github/workflows/ci.py test
  55. linux-package:
  56. name: Linux package
  57. runs-on: ubuntu-latest
  58. env:
  59. CFLAGS: -funsigned-char
  60. steps:
  61. - name: Checkout source code
  62. uses: actions/checkout@v3
  63. with:
  64. fetch-depth: 0 # needed for :commit: docs role
  65. - name: Test for trailing whitespace
  66. run: if grep -Inr '\s$' kitty kitty_tests kittens docs *.py *.asciidoc *.rst *.go .gitattributes .gitignore; then echo Trailing whitespace found, aborting.; exit 1; fi
  67. - name: Set up Python
  68. uses: actions/setup-python@v4
  69. with:
  70. python-version: "3.12"
  71. - name: Install Go
  72. uses: actions/setup-go@v4
  73. with:
  74. go-version-file: go.mod
  75. cache: false
  76. - name: Cache Go build artifacts separately
  77. uses: actions/cache@v3
  78. with:
  79. path: |
  80. ~/.cache/go-build
  81. ~/go/pkg/mod
  82. key: ${{ runner.os }}-golang-static-${{ hashFiles('**/go.sum') }}
  83. restore-keys: |
  84. ${{ runner.os }}-golang-static-
  85. - name: Install build-only deps
  86. run: python -m pip install -r docs/requirements.txt ruff mypy types-requests types-docutils
  87. - name: Run ruff
  88. run: ruff check .
  89. - name: Run gofmt
  90. run: go version && python .github/workflows/ci.py gofmt
  91. - name: Build kitty package
  92. run: python .github/workflows/ci.py package
  93. - name: Build kitty
  94. run: python setup.py build --debug
  95. - name: Run mypy
  96. run: which python && python -m mypy --version && ./test.py mypy
  97. - name: Run go vet
  98. run: go version && go vet ./...
  99. - name: Build man page
  100. run: make FAIL_WARN=1 man
  101. - name: Build HTML docs
  102. run: make FAIL_WARN=1 html
  103. - name: Build static kittens
  104. run: python setup.py build-static-binaries
  105. bundle:
  106. name: Bundle test (${{ matrix.os }})
  107. runs-on: ${{ matrix.os }}
  108. strategy:
  109. matrix:
  110. os: [ubuntu-latest, macos-latest]
  111. env:
  112. KITTY_BUNDLE: 1
  113. steps:
  114. - name: Checkout source code
  115. uses: actions/checkout@v3
  116. with:
  117. fetch-depth: 10
  118. - name: Install Go
  119. uses: actions/setup-go@v4
  120. with:
  121. go-version-file: go.mod
  122. - name: Build kitty
  123. run: which python3 && python3 .github/workflows/ci.py build
  124. - name: Test kitty
  125. run: python3 .github/workflows/ci.py test
  126. brew:
  127. name: macOS Brew
  128. runs-on: macos-latest
  129. steps:
  130. - name: Checkout source code
  131. uses: actions/checkout@v3
  132. with:
  133. fetch-depth: 0 # needed for :commit: docs role
  134. - name: Set up Python
  135. uses: actions/setup-python@v4
  136. with:
  137. python-version: "3.10"
  138. - name: Install Go
  139. uses: actions/setup-go@v4
  140. with:
  141. go-version-file: go.mod
  142. - name: Build kitty
  143. run: python3 .github/workflows/ci.py build
  144. - name: Test kitty
  145. run: python3 .github/workflows/ci.py test
  146. - name: Install deps for docs
  147. run: python3 -m pip install -r docs/requirements.txt
  148. - name: Builds docs
  149. run: make FAIL_WARN=1 docs
  150. - name: Build kitty package
  151. run: python3 .github/workflows/ci.py package
  152. linux-dev:
  153. name: Test ./dev.sh
  154. runs-on: ubuntu-latest
  155. steps:
  156. - name: Checkout source code
  157. uses: actions/checkout@v3
  158. with:
  159. fetch-depth: 10
  160. - name: Install build deps
  161. run: sudo apt-get install -y curl xz-utils build-essential git pkg-config libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev libxkbcommon-x11-dev libfontconfig-dev libx11-xcb-dev libdbus-1-dev
  162. - name: Install Go
  163. uses: actions/setup-go@v4
  164. with:
  165. go-version-file: go.mod
  166. - name: Build kitty
  167. run: ./dev.sh build