fix: multiple scopes

pull/261/head
Nic van Dessel 2024-02-29 08:54:16 -08:00
parent 70d5bdc186
commit 46e6918d55
No known key found for this signature in database
GPG Key ID: 88AE94AD8B681486
2 changed files with 52 additions and 2 deletions

View File

@ -703,3 +703,53 @@ jobs:
name: Package Coverage results (all)
path: ${{ steps.packageAllTests.outputs.coveragePath }}
retention-days: 14
testPackageRunnerWithScopeRegistryAndMultipleScopes:
name: Test package mode in all modes with Scoped Registry and Multiple Scopes 🔎📦✨
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- unity-package-with-correct-tests/com.dependencyexample.testpackage
unityVersion:
- 2022.3.13f1
- 2023.1.19f1
- 2023.2.2f1
steps:
###########################
# Checkout #
###########################
- uses: actions/checkout@v4
with:
lfs: true
# Configure test runner
- name: Run tests
id: packageAllTests
uses: ./
with:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
testMode: all
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+dependencyexample.testpackage.*,-*Tests*'
packageMode: true
scopedRegistryUrl: https://package.openupm.com
registryScopes: 'com.cysharp, com.cysharp.unitask'
# Test implicit artifactsPath, by not setting it
# Upload artifacts
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: Package test results (all)
path: ${{ steps.packageAllTests.outputs.artifactsPath }}
retention-days: 14
# Upload coverage
- name: Upload coverage results
uses: actions/upload-artifact@v3
with:
name: Package Coverage results (all)
path: ${{ steps.packageAllTests.outputs.coveragePath }}
retention-days: 14

View File

@ -100,11 +100,11 @@ if [ "$PACKAGE_MODE" = "true" ]; then
--arg packageName "$PACKAGE_NAME" \
--arg projectPath "$UNITY_PROJECT_PATH" \
--arg scopedRegistryUrl "$SCOPED_REGISTRY_URL" \
--arg registryScopes "$REGISTRY_SCOPES" \
--argjson registryScopes "$(echo "[\"$REGISTRY_SCOPES\"]" | sed 's/,/","/g')" \
'.dependencies += {"com.unity.testtools.codecoverage": "1.1.1"} |
.dependencies += {"\($packageName)": "file:\($projectPath)"} |
. += {testables: ["\($packageName)"]} |
. += {scopedRegistries: [{"name":"dependency", "url":"\($scopedRegistryUrl)", scopes: ["\($registryScopes)"]}] }' \
. += {scopedRegistries: [{"name":"dependency", "url":"\($scopedRegistryUrl)", scopes: $registryScopes}] }' \
> "$PACKAGE_MANIFEST_PATH"
UNITY_PROJECT_PATH="$TEMP_PROJECT_PATH"