logo

live-bootstrap

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

bwrap.yml (5444B)


  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. mirror
  33. mirror-state
  34. key: cache-${{ hashFiles('steps/*/sources') }}
  35. restore-keys: |
  36. cache-
  37. - name: Get sources
  38. if: steps.cache.outputs.cache-hit != 'true'
  39. run: mkdir -p mirror mirror-state && ./mirror.sh mirror mirror-state
  40. - name: Cache sources
  41. if: steps.cache.outputs.cache-hit != 'true'
  42. uses: actions/cache/save@v4
  43. with:
  44. path: |
  45. mirror
  46. mirror-state
  47. key: cache-${{ hashFiles('steps/*/sources') }}
  48. - name: Run bootstrap
  49. run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass1 --mirror file://${PWD}/mirror
  50. - name: Archive created packages
  51. if: failure() # archive failed builds progress
  52. uses: actions/upload-artifact@v4
  53. with:
  54. name: packages
  55. path: target/external/repo/**
  56. - name: Tar pass1 image
  57. run: tar -cf pass1_image.tar target
  58. - name: Archive pass1_image
  59. uses: actions/upload-artifact@v4
  60. with:
  61. name: internal_pass1_image
  62. path: pass1_image.tar
  63. pass2:
  64. name: Run up to Python bootstrap under bubblewrap
  65. needs: pass1
  66. runs-on: ubuntu-24.04
  67. steps:
  68. - name: Install bubblewrap
  69. run: sudo apt install bubblewrap
  70. - name: Checkout repo
  71. uses: actions/checkout@v4
  72. with:
  73. submodules: recursive
  74. # There is a strange bug(?) in nongnu, when you clone a git repository
  75. # against a commit != HEAD with depth=1, it errors out.
  76. fetch-depth: 0
  77. - name: Work around Ubuntu 24.04 bubblewrap bug
  78. run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
  79. - name: Get pass1_image
  80. uses: actions/download-artifact@v4
  81. with:
  82. name: internal_pass1_image
  83. - name: Extract pass1_image
  84. run: tar -xf pass1_image.tar
  85. - name: Query cache for sources
  86. id: cache
  87. uses: actions/cache/restore@v4
  88. with:
  89. path: |
  90. mirror
  91. mirror-state
  92. key: cache-${{ hashFiles('steps/*/sources') }}
  93. fail-on-cache-miss: true
  94. - name: Copy distfiles
  95. run: ./download-distfiles.sh file:///${PWD}/mirror
  96. - name: Run bootstrap
  97. run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass2
  98. - name: Archive created packages
  99. if: failure() # archive failed builds progress
  100. uses: actions/upload-artifact@v4
  101. with:
  102. name: internal_packages_pass2
  103. path: target/external/repo/**
  104. - name: Tar pass2 image
  105. run: tar -cf pass2_image.tar target
  106. - name: Archive pass2_image
  107. uses: actions/upload-artifact@v4
  108. with:
  109. name: internal_pass2_image
  110. path: pass2_image.tar
  111. pass3:
  112. name: Run remaining builds under bubblewrap
  113. needs: pass2
  114. runs-on: ubuntu-24.04
  115. steps:
  116. - name: Install bubblewrap
  117. run: sudo apt install bubblewrap
  118. - name: Checkout repo
  119. uses: actions/checkout@v4
  120. with:
  121. submodules: recursive
  122. # There is a strange bug(?) in nongnu, when you clone a git repository
  123. # against a commit != HEAD with depth=1, it errors out.
  124. fetch-depth: 0
  125. - name: Work around Ubuntu 24.04 bubblewrap bug
  126. run: sudo cp .github/workflows/bwrap.apparmor /etc/apparmor.d/bwrap && sudo systemctl reload apparmor
  127. - name: Get pass2_image
  128. uses: actions/download-artifact@v4
  129. with:
  130. name: internal_pass2_image
  131. - name: Extract pass2_image
  132. run: tar -xf pass2_image.tar
  133. - name: Query cache for sources
  134. id: cache
  135. uses: actions/cache/restore@v4
  136. with:
  137. path: |
  138. mirror
  139. mirror-state
  140. key: cache-${{ hashFiles('steps/*/sources') }}
  141. fail-on-cache-miss: true
  142. - name: Copy distfiles
  143. run: ./download-distfiles.sh file:///${PWD}/mirror
  144. - name: Run bootstrap
  145. run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass3 --mirror file://${PWD}/mirror
  146. - name: Archive created packages
  147. if: always() # archive both failed and successful builds
  148. uses: actions/upload-artifact@v4
  149. with:
  150. name: packages
  151. path: target/external/repo/**