ci.yml 3.8 KB

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