test.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Secrets
  2. # UNITY_LICENSE:
  3. name: test
  4. on:
  5. push:
  6. branches:
  7. - develop
  8. tags:
  9. - "!*"
  10. pull_request:
  11. types:
  12. - opened
  13. - synchronize
  14. jobs:
  15. unity-test:
  16. runs-on: ubuntu-latest
  17. strategy:
  18. fail-fast: false
  19. matrix:
  20. unityVersion: [
  21. "2018.3.14f1",
  22. "2018.4.30f1",
  23. "2019.1.14f1",
  24. "2019.2.21f1",
  25. "2019.3.15f1",
  26. "2019.4.16f1",
  27. "2020.1.17f1",
  28. "2020.2.1f1",
  29. ]
  30. steps:
  31. # Checkout sandbox project
  32. - uses: actions/checkout@v2
  33. with:
  34. ref: sandbox
  35. submodules: true
  36. fetch-depth: 0
  37. # Update package submodule
  38. - name: "Update package submodule"
  39. working-directory: Packages/dev
  40. run: git checkout ${{ github.sha }}
  41. - uses: actions/cache@v2
  42. with:
  43. path: Library
  44. key: Library-${{ matrix.unityVersion }}-${{ github.sha }}
  45. restore-keys: |
  46. Library-${{ matrix.unityVersion }}-
  47. Library-
  48. # Install codecoverage package
  49. # - name: "Install codecoverage package"
  50. # if: startsWith(matrix.unityVersion, '2019.4.')
  51. # run: |
  52. # npx openupm-cli add -f com.unity.testtools.codecoverage@0.4.0-preview
  53. # Run tests
  54. - name: "Run tests"
  55. uses: game-ci/unity-test-runner@main
  56. with:
  57. unityVersion: ${{ matrix.unityVersion }}
  58. customParameters: -nographics
  59. env:
  60. UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
  61. # - uses: actions/upload-artifact@v2
  62. # if: always()
  63. # with:
  64. # name: TestResults-${{ matrix.unityVersion }}
  65. # path: |
  66. # artifacts/*.xml
  67. # CodeCoverage/**/TestCoverageResults_*.xml
  68. # publish:
  69. # needs: unity-test
  70. # runs-on: ubuntu-latest
  71. # if: always()
  72. # steps:
  73. # - uses: actions/download-artifact@v2
  74. # with:
  75. # path: artifacts
  76. # - uses: testspace-com/setup-testspace@v1
  77. # with:
  78. # domain: ${{github.repository_owner}}
  79. # - name: Push test results
  80. # if: always()
  81. # run: |
  82. # testspace `find . -name '*.xml' | tr '\n' ' '`