ci.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. name: CI
  2. on:
  3. push:
  4. pull_request:
  5. jobs:
  6. eslint:
  7. name: eslint
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout repository
  11. uses: actions/checkout@v4
  12. - name: Run eslint
  13. run: sudo npm install -g eslint; make eslint
  14. test:
  15. runs-on: ubuntu-latest
  16. name: Build and test
  17. timeout-minutes: 60
  18. steps:
  19. - name: Checkout repository
  20. uses: actions/checkout@v4
  21. - name: Setup Node.js version
  22. uses: actions/setup-node@v4
  23. with:
  24. node-version: '20'
  25. check-latest: true
  26. - name: Setup toolchain
  27. run: |
  28. rustup toolchain install stable --profile minimal
  29. rustup target add wasm32-unknown-unknown
  30. rustup component add rustfmt
  31. - name: Install APT packages
  32. run: |
  33. sudo apt-get update -y
  34. sudo apt-get install nasm gdb qemu-system-x86 libc6-dev-i386 -y
  35. - name: Build all-debug
  36. run: make all-debug
  37. - name: Build all
  38. run: make all
  39. - name: Build fallback
  40. run: make build/v86-fallback.wasm
  41. - name: rustfmt check
  42. run: make rustfmt
  43. - name: Fetch kvm-unit-test cache
  44. uses: actions/cache@v3
  45. id: cache-kvm-unit-test
  46. with:
  47. path: tests/kvm-unit-tests/
  48. key: ${{ runner.os }}-kvm-unit-test
  49. - name: Build kvm-unit-test
  50. if: steps.cache-kvm-unit-test.outputs.cache-hit != 'true'
  51. run: (cd tests/kvm-unit-tests && ./configure && make x86/realmode.flat)
  52. - name: Run kvm-unit-test
  53. run: tests/kvm-unit-tests/run.js tests/kvm-unit-tests/x86/realmode.flat
  54. - name: Fetch namsmtests cache
  55. uses: actions/cache@v3
  56. id: cache-nasmtests
  57. with:
  58. path: tests/nasm/build/
  59. key: ${{ runner.os }}-nasmtests
  60. - name: Run nasmtests
  61. run: MAX_PARALLEL_TESTS=1 make nasmtests
  62. - name: Run nasmtests-force-jit
  63. run: MAX_PARALLEL_TESTS=1 make nasmtests-force-jit
  64. - name: Run rust-test
  65. run: make rust-test
  66. - name: Fetch image cache
  67. uses: actions/cache@v3
  68. id: cache-images
  69. with:
  70. path: images/
  71. key: ${{ runner.os }}-images-v2
  72. - name: Download uncached images
  73. if: steps.cache-images.outputs.cache-hit != 'true'
  74. run: wget -nv -P images/ https://i.copy.sh/{linux.iso,linux3.iso,linux4.iso,buildroot-bzimage68.bin,TinyCore-11.0.iso,oberon.img,msdos.img,openbsd-floppy.img,kolibri.img,windows101.img,os8.img,freedos722.img,mobius-fd-release5.img}
  75. - name: Run api-tests
  76. run: make api-tests
  77. - name: Run qemutests
  78. run: make qemutests
  79. - name: Run qemutests-release
  80. run: make qemutests-release
  81. - name: Run jitpagingtests
  82. run: make jitpagingtests
  83. - name: Run integration tests
  84. run: MAX_PARALLEL_TESTS=1 make tests
  85. - name: Run devices tests
  86. run: make devices-test
  87. - name: Run expect tests
  88. run: make expect-tests
  89. - name: Upload the artifact
  90. uses: actions/upload-artifact@v3
  91. with:
  92. name: v86
  93. path: |
  94. build/libv86*.js
  95. build/libv86*.js.map
  96. build/v86*.wasm
  97. upload:
  98. name: Upload release
  99. runs-on: ubuntu-latest
  100. needs: test
  101. if: github.ref == 'refs/heads/master'
  102. steps:
  103. - name: Delete old release and tag
  104. uses: dev-drprasad/delete-tag-and-release@v1.0.1
  105. with:
  106. delete_release: true
  107. tag_name: latest
  108. github_token: ${{ secrets.GITHUB_TOKEN }}
  109. - name: Get artifacts
  110. uses: actions/download-artifact@v3
  111. with:
  112. name: v86
  113. path: build
  114. - name: Display structure of downloaded files
  115. run: ls -R
  116. - name: Release to GitHub
  117. uses: ncipollo/release-action@v1
  118. with:
  119. name: Latest Release
  120. tag: latest
  121. commit: master
  122. body: ${{ github.event.head_commit.message }}
  123. artifacts: "build/libv86*.js,build/libv86*.js.map,build/v86*.wasm"
  124. prerelease: true