Remove unuse DotSettings #260
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2021-2025 Koji Hasegawa. | |
| # This software is released under the MIT License. | |
| name: Test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '**.md' | |
| - '.github/**' | |
| - '!.github/workflows/test.yml' | |
| pull_request: | |
| types: [ opened, synchronize, reopened ] # Same as default | |
| paths-ignore: | |
| - '**.md' | |
| - '.github/**' | |
| - '!.github/workflows/test.yml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: { } | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| test: | |
| if: github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets. | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| unityVersion: # Available versions see: https://game.ci/docs/docker/versions | |
| - 2019.4.40f1 | |
| - 2020.3.49f1 | |
| - 2021.3.45f1 | |
| - 2022.3.62f1 | |
| - 6000.0.43f1 | |
| - 6000.0.44f1 # pin test-framework v1.5.1 | |
| - 6000.0.59f2 # pin test-framework v1.6.0 | |
| - 6000.2.5f1 # pin test-framework v1.5.1 | |
| - 6000.2.6f1 # pin test-framework v1.6.0 | |
| - 6000.3.1f1 | |
| testMode: | |
| - All # run tests in editor | |
| include: | |
| - unityVersion: 6000.3.1f1 | |
| octocov: true | |
| - unityVersion: 6000.3.1f1 | |
| testMode: Standalone # run tests on player | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| submodules: false | |
| lfs: false | |
| - name: Restore cache | |
| uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 | |
| with: | |
| path: Library | |
| key: Library-${{ runner.os }}-${{ matrix.unityVersion }}-${{ hashFiles('Packages/packages-lock.json') }} | |
| restore-keys: | | |
| Library-${{ runner.os }}-${{ matrix.unityVersion }}- | |
| Library-${{ runner.os }}- | |
| Library- | |
| - name: Set coverage assembly filters | |
| run: | | |
| assemblies=$(find ./Packages -name "*.asmdef" | sed -e s/.*\\//\+/ | sed -e s/\\.asmdef// | sed -e s/^.*\\.Tests//) | |
| assemblies+=("+LocalPackageSample*") | |
| # shellcheck disable=SC2001,SC2048,SC2086 | |
| echo "assembly_filters=+<assets>,$(echo ${assemblies[*]} | sed -e s/\ /,/g),-*.Tests" >> "$GITHUB_ENV" | |
| - name: Set license secret key | |
| run: echo "secret_key=UNITY_LICENSE_$(echo ${{ matrix.unityVersion }} | cut -c 1-4)" >> "$GITHUB_ENV" | |
| - name: Run tests | |
| uses: game-ci/unity-test-runner@0ff419b913a3630032cbe0de48a0099b5a9f0ed9 # v4 | |
| with: | |
| githubToken: ${{ secrets.GITHUB_TOKEN }} | |
| unityVersion: ${{ matrix.unityVersion }} # Default is `auto` | |
| checkName: test result (${{ matrix.unityVersion }}, ${{ matrix.testMode }}) | |
| customParameters: -testCategory "!IgnoreCI;!Integration" -testHelperScreenshotDirectory /github/workspace/artifacts/Screenshots | |
| # Note: `/github/workspace/artifacts` is the artifacts path inside the game-ci container | |
| coverageOptions: generateAdditionalMetrics;generateTestReferences;generateHtmlReport;generateAdditionalReports;dontClear;assemblyFilters:${{ env.assembly_filters }} | |
| # see: https://docs.unity3d.com/Packages/[email protected]/manual/CoverageBatchmode.html | |
| testMode: ${{ matrix.testMode }} | |
| env: | |
| UNITY_LICENSE: ${{ secrets[env.secret_key] }} | |
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| id: test | |
| - name: Set coverage path for octocov | |
| run: sed -i -r 's/\.\/Logs/${{ steps.test.outputs.coveragePath }}/' .octocov.yml | |
| if: ${{ matrix.octocov }} | |
| - name: Run octocov | |
| uses: k1LoW/octocov-action@73d561f65d59e66899ed5c87e4621a913b5d5c20 # v1 | |
| if: ${{ matrix.octocov }} | |
| - name: Upload test results | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: TestResults-Unity${{ matrix.unityVersion }}-${{ matrix.testMode }} | |
| path: | | |
| ${{ steps.test.outputs.artifactsPath }} | |
| ${{ steps.test.outputs.coveragePath }} | |
| if: always() |