rust.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. name: Rust
  2. on: [push, pull_request, workflow_dispatch]
  3. env:
  4. CARGO_TERM_COLOR: always
  5. DATABASE_URL: "sqlite://./dim_dev.db"
  6. jobs:
  7. build:
  8. name: Build
  9. runs-on: ubuntu-latest
  10. steps:
  11. - run: sudo apt-get update
  12. - run: sudo apt-get install -y libva-dev libva-drm2 libva2 sqlite3 ffmpeg
  13. - uses: actions/checkout@v2
  14. # - name: Download UI artifacts
  15. # uses: dawidd6/action-download-artifact@v2
  16. # with:
  17. # workflow: react.yml
  18. # workflow_conclusion: success
  19. # branch: master
  20. # name: webui
  21. # path: ui/build
  22. # repo: ${{github.repository}}
  23. - uses: actions-rs/toolchain@v1
  24. with:
  25. profile: minimal
  26. toolchain: stable
  27. override: true
  28. components: cargo
  29. - name: Download ffmpeg artifact
  30. uses: dsaltares/fetch-gh-release-asset@master
  31. with:
  32. repo: "Dusk-Labs/ffmpeg-static"
  33. version: "tags/ffmpeg-all-0.0.1"
  34. file: "ffmpeg"
  35. token: ${{ secrets.GITHUB_TOKEN }}
  36. - name: Download ffprobe artifact
  37. uses: dsaltares/fetch-gh-release-asset@master
  38. with:
  39. repo: "Dusk-Labs/ffmpeg-static"
  40. version: "tags/ffmpeg-all-0.0.1"
  41. file: "ffprobe"
  42. token: ${{ secrets.GITHUB_TOKEN }}
  43. - name: Create release dir
  44. run: |
  45. mkdir -p release/utils
  46. cp ffmpeg release/utils/ffmpeg
  47. cp ffprobe release/utils/ffprobe
  48. chmod +x release/utils/ffmpeg
  49. chmod +x release/utils/ffprobe
  50. - name: Test Dim
  51. uses: actions-rs/cargo@v1
  52. with:
  53. command: test
  54. args: --tests
  55. - name: Build Dim
  56. uses: actions-rs/cargo@v1
  57. with:
  58. command: build
  59. args: --verbose --release
  60. - name: Copy dim binaries
  61. run: |
  62. cp target/release/dim release/dim
  63. chmod +x release/dim
  64. - name: Compress release dir
  65. run: tar -zcvf release.tar.gz release
  66. - name: Save artifacts
  67. uses: actions/upload-artifact@v2
  68. with:
  69. name: release
  70. path: release.tar.gz