test.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.2.21f1",
  24. "2019.3.15f1",
  25. "2019.4.16f1",
  26. "2020.1.17f1",
  27. "2020.2.1f1",
  28. ]
  29. steps:
  30. # Checkout sandbox project
  31. - uses: actions/checkout@v2
  32. with:
  33. ref: sandbox
  34. submodules: true
  35. fetch-depth: 0
  36. # Update package submodule
  37. - name: "Update package submodule"
  38. working-directory: Packages/dev
  39. run: git checkout ${{ github.sha }}
  40. - uses: actions/cache@v2
  41. with:
  42. path: Library
  43. key: Library-${{ matrix.unityVersion }}-${{ github.sha }}
  44. restore-keys: |
  45. Library-${{ matrix.unityVersion }}-
  46. Library-
  47. # Install codecoverage package
  48. - name: "Install codecoverage package"
  49. if: startsWith(matrix.unityVersion, '2019.4.')
  50. run: |
  51. npx openupm-cli add -f com.unity.testtools.codecoverage@0.4.0-preview
  52. # Run tests
  53. - name: "Run tests"
  54. uses: game-ci/unity-test-runner@main
  55. with:
  56. unityVersion: ${{ matrix.unityVersion }}
  57. customParameters: -nographics -enableCodeCoverage -coverageOptions assemblyFilters:+Coffee.UIParticle.*Tests
  58. env:
  59. UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
  60. - uses: actions/upload-artifact@v2
  61. if: always()
  62. with:
  63. name: TestResults-${{ matrix.unityVersion }}
  64. path: |
  65. artifacts/*.xml
  66. CodeCoverage/**/TestCoverageResults_*.xml
  67. publish:
  68. needs: unity-test
  69. runs-on: ubuntu-latest
  70. if: always()
  71. steps:
  72. - uses: actions/download-artifact@v2
  73. with:
  74. path: artifacts
  75. - uses: testspace-com/setup-testspace@v1
  76. with:
  77. domain: ${{github.repository_owner}}
  78. - name: Push test results
  79. if: always()
  80. run: |
  81. testspace `find . -name '*.xml' | tr '\n' ' '`