diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml new file mode 100644 index 0000000..3ddf3ea --- /dev/null +++ b/.github/workflows/test-runner.yml @@ -0,0 +1,52 @@ +name: Run Tests + +on: + pull_request: + types: [ opened, reopened ] + workflow_dispatch: + +jobs: + runAllTests: + name: ${{ matrix.unityVersion }} ${{ matrix.testMode }} tests + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + testMode: + - playmode + - editmode + unityVersion: + - 2020.3.0f1 + steps: + - name: Checkout Unity-SDK Repository + uses: actions/checkout@v3 + - name: Cache Project + uses: actions/cache@v3 + with: + path: Library + key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} + restore-keys: | + Library- + - name: Get npm + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install openupm-cli + run: npm install -g openupm-cli + - run: pwd + - name: Add core as package + run: openupm add com.readyplayerme.core + - name: Run Tests + uses: game-ci/unity-test-runner@v2 + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + with: + unityVersion: ${{ matrix.unityVersion }} + testMode: ${{ matrix.testMode }} + projectPath: ${{ matrix.projectPath }} + checkName: ${{ matrix.unityVersion }} ${{ matrix.testMode }} tests result + githubToken: ${{ secrets.GITHUB_TOKEN }} + coverageOptions: "generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*"