You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ci.yml 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. name: CI/CD
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - canary
  7. tags:
  8. - v*
  9. paths:
  10. - .github/workflows/*
  11. - src/*
  12. pull_request:
  13. branches:
  14. - canary
  15. paths:
  16. - .github/workflows/*
  17. - src/*
  18. jobs:
  19. build:
  20. name: Build (${{ matrix.os-short }}-${{ matrix.device }})
  21. runs-on: ${{ matrix.os }}
  22. # Strategy
  23. # or a.k.a variables for multiple platforms
  24. # https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstrategy
  25. strategy:
  26. fail-fast: false
  27. matrix:
  28. os:
  29. #- ubuntu-latest
  30. #- windows-latest
  31. - macOS-latest
  32. device:
  33. - any
  34. - cpuonly
  35. include:
  36. - os: ubuntu-latest # Ubuntu
  37. os-short: ubuntu
  38. os-ext: deb
  39. python: python3
  40. - os: ubuntu-latest # Ubuntu & GPU
  41. device: any
  42. torch-version: https://download.pytorch.org/whl/cu100/torch-1.1.0-cp37-cp37m-linux_x86_64.whl
  43. - os: ubuntu-latest # Ubuntu & CPU
  44. device: cpuonly
  45. torch-version: https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-linux_x86_64.whl
  46. - os: windows-latest # Windows
  47. os-short: windows
  48. os-ext: exe
  49. python: python
  50. pyinstaller-args: --add-binary "./third/msvcp/msvcp140.dll;."
  51. - os: windows-latest # Windows & GPU
  52. device: any
  53. torch-version: https://download.pytorch.org/whl/cu100/torch-1.1.0-cp37-cp37m-win_amd64.whl
  54. - os: windows-latest # Windows & CPU
  55. device: cpuonly
  56. torch-version: https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-win_amd64.whl
  57. - os: macOS-latest # macOS
  58. os-short: macos
  59. os-ext: dmg
  60. python: python3
  61. torch-version: torch
  62. exclude:
  63. - os: macOS-latest
  64. device: any
  65. steps:
  66. - name: Dump GitHub context
  67. env:
  68. GITHUB_CONTEXT: ${{ toJson(github) }}
  69. run: echo "$GITHUB_CONTEXT"
  70. continue-on-error: true
  71. - name: Dump runner context
  72. if: false
  73. env:
  74. RUNNER_CONTEXT: ${{ toJson(runner) }}
  75. run: echo "$RUNNER_CONTEXT"
  76. continue-on-error: true
  77. - uses: actions/checkout@v1
  78. with:
  79. submodules: true
  80. - name: Use Python 3.7
  81. uses: actions/setup-python@v1
  82. if: runner.os != 'macOS'
  83. with:
  84. python-version: 3.7
  85. architecture: x64
  86. - name: Use Node.js 12.x
  87. uses: actions/setup-node@v1
  88. with:
  89. node-version: 12.x
  90. - name: Use Yarn
  91. run: npm install -g yarn
  92. - name: Setup DreamPower
  93. working-directory: src/cli
  94. run: |
  95. ${{ matrix.python }} -m pip install pyinstaller
  96. ${{ matrix.python }} -m pip install numpy==1.16.4
  97. ${{ matrix.python }} -m pip install pillow==6.1.0
  98. ${{ matrix.python }} -m pip install opencv-python==4.1.0.25
  99. ${{ matrix.python }} -m pip install rsa==4.0
  100. ${{ matrix.python }} -m pip install imageio==2.5.0
  101. ${{ matrix.python }} -m pip install python-dotenv==0.10.3
  102. ${{ matrix.python }} -m pip install rook==0.1.73
  103. ${{ matrix.python }} -m pip install sentry-sdk==0.10.2
  104. ${{ matrix.python }} -m pip --no-cache-dir install ${{ matrix.torch-version }}
  105. ${{ matrix.python }} -m pip --no-cache-dir install torchvision==0.2.2.post3
  106. - name: Setup DreamTime
  107. working-directory: src
  108. run: |
  109. yarn install
  110. - name: Build DreamPower
  111. working-directory: src/cli
  112. run: |
  113. ${{ matrix.python }} -m PyInstaller main.py -y --onedir --name "dreampower" --distpath "../../dist" ${{ matrix.pyinstaller-args }}
  114. - name: Build & Deploy DreamTime
  115. working-directory: src
  116. env:
  117. GITHUB_TOKEN: ${{ secrets.TOKEN }}
  118. BUILD_DEVICE: ${{ matrix.device }}
  119. run: |
  120. yarn release --verbose --ci --github.assets="../dist/DreamTime-${{ matrix.os-short }}-${{ matrix.device }}.${{ matrix.os-ext }}"
  121. - name: Upload Internal Artifact
  122. uses: actions/upload-artifact@v1
  123. with:
  124. name: ${{ matrix.os-short }}-${{ matrix.device }}
  125. path: dist/DreamTime-${{ matrix.os-short }}-${{ matrix.device }}.${{ matrix.os-ext }}