logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

bwrap.yml (5649B)


  1. # SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
  2. #
  3. # SPDX-License-Identifier: GPL-3.0-or-later
  4. name: Run under bubblewrap
  5. on:
  6. workflow_dispatch:
  7. pull_request:
  8. push:
  9. branches:
  10. - master
  11. jobs:
  12. pass1:
  13. name: Run up to Linux build under bubblewrap
  14. runs-on: ubuntu-24.04
  15. steps:
  16. - name: Install bubblewrap
  17. run: sudo apt install bubblewrap
  18. - name: Checkout repo
  19. uses: actions/checkout@v4
  20. with:
  21. submodules: recursive
  22. # There is a strange bug(?) in nongnu, when you clone a git repository
  23. # against a commit != HEAD with depth=1, it errors out.
  24. fetch-depth: 0
  25. - name: Work around Ubuntu 24.04 bubblewrap bug
  26. run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
  27. - name: Query cache for sources
  28. id: cache
  29. uses: actions/cache/restore@v4
  30. with:
  31. path: |
  32. distfiles
  33. key: cache-${{ hashFiles('steps/*/sources') }}
  34. - name: Get sources
  35. if: steps.cache.outputs.cache-hit != 'true'
  36. run: ./download-distfiles.sh
  37. - name: Cache sources
  38. if: steps.cache.outputs.cache-hit != 'true'
  39. uses: actions/cache/save@v4
  40. with:
  41. path: |
  42. distfiles
  43. key: cache-${{ hashFiles('steps/*/sources') }}
  44. - name: Run bootstrap
  45. run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass1
  46. - name: Archive created packages
  47. if: failure() # archive failed builds progress
  48. uses: actions/upload-artifact@v4
  49. with:
  50. name: packages
  51. path: target/external/repo/**
  52. - name: Tar pass1 image
  53. run: tar -cf pass1_image.tar target
  54. - name: Archive pass1_image
  55. uses: actions/upload-artifact@v4
  56. with:
  57. name: internal_pass1_image
  58. path: pass1_image.tar
  59. pass2:
  60. name: Run up to Python bootstrap under bubblewrap
  61. needs: pass1
  62. runs-on: ubuntu-24.04
  63. steps:
  64. - name: Install bubblewrap
  65. run: sudo apt install bubblewrap
  66. - name: Checkout repo
  67. uses: actions/checkout@v4
  68. with:
  69. submodules: recursive
  70. # There is a strange bug(?) in nongnu, when you clone a git repository
  71. # against a commit != HEAD with depth=1, it errors out.
  72. fetch-depth: 0
  73. - name: Work around Ubuntu 24.04 bubblewrap bug
  74. run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
  75. - name: Get pass1_image
  76. uses: actions/download-artifact@v4
  77. with:
  78. name: internal_pass1_image
  79. - name: Extract pass1_image
  80. run: tar -xf pass1_image.tar
  81. - name: Query cache for sources
  82. id: cache
  83. uses: actions/cache/restore@v4
  84. with:
  85. path: |
  86. distfiles
  87. key: cache-${{ hashFiles('steps/*/sources') }}
  88. - name: Get sources
  89. if: steps.cache.outputs.cache-hit != 'true'
  90. run: ./download-distfiles.sh
  91. - name: Cache sources
  92. if: steps.cache.outputs.cache-hit != 'true'
  93. uses: actions/cache/save@v4
  94. with:
  95. path: |
  96. distfiles
  97. key: cache-${{ hashFiles('steps/*/sources') }}
  98. - name: Run bootstrap
  99. run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass2
  100. - name: Archive created packages
  101. if: failure() # archive failed builds progress
  102. uses: actions/upload-artifact@v4
  103. with:
  104. name: internal_packages_pass2
  105. path: target/external/repo/**
  106. - name: Tar pass2 image
  107. run: tar -cf pass2_image.tar target
  108. - name: Archive pass2_image
  109. uses: actions/upload-artifact@v4
  110. with:
  111. name: internal_pass2_image
  112. path: pass2_image.tar
  113. pass3:
  114. name: Run remaining builds under bubblewrap
  115. needs: pass2
  116. runs-on: ubuntu-24.04
  117. steps:
  118. - name: Install bubblewrap
  119. run: sudo apt install bubblewrap
  120. - name: Checkout repo
  121. uses: actions/checkout@v4
  122. with:
  123. submodules: recursive
  124. # There is a strange bug(?) in nongnu, when you clone a git repository
  125. # against a commit != HEAD with depth=1, it errors out.
  126. fetch-depth: 0
  127. - name: Work around Ubuntu 24.04 bubblewrap bug
  128. run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
  129. - name: Get pass2_image
  130. uses: actions/download-artifact@v4
  131. with:
  132. name: internal_pass2_image
  133. - name: Extract pass2_image
  134. run: tar -xf pass2_image.tar
  135. - name: Query cache for sources
  136. id: cache
  137. uses: actions/cache/restore@v4
  138. with:
  139. path: |
  140. distfiles
  141. key: cache-${{ hashFiles('steps/*/sources') }}
  142. - name: Get sources
  143. if: steps.cache.outputs.cache-hit != 'true'
  144. run: ./download-distfiles.sh
  145. - name: Cache sources
  146. if: steps.cache.outputs.cache-hit != 'true'
  147. uses: actions/cache/save@v4
  148. with:
  149. path: |
  150. distfiles
  151. key: cache-${{ hashFiles('steps/*/sources') }}
  152. - name: Run bootstrap
  153. run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass3
  154. - name: Archive created packages
  155. if: always() # archive both failed and successful builds
  156. uses: actions/upload-artifact@v4
  157. with:
  158. name: packages
  159. path: target/external/repo/**