mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-01 06:16:14 -07:00
Compare commits
8 Commits
linux-exte
...
feature/us
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4233b08bae | ||
|
|
2badde1790 | ||
|
|
eba50f7627 | ||
|
|
f8b20890d9 | ||
|
|
b57598a959 | ||
|
|
7b2ec07fc1 | ||
|
|
3d3a018c23 | ||
|
|
a12e3e829e |
5
.eslintignore
Normal file
5
.eslintignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
dist/
|
||||||
|
lib/
|
||||||
|
node_modules/
|
||||||
|
jest.config.js
|
||||||
|
src/types/
|
||||||
91
.eslintrc.json
Normal file
91
.eslintrc.json
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"plugins": ["jest", "@typescript-eslint", "prettier", "unicorn"],
|
||||||
|
"extends": ["plugin:unicorn/recommended", "plugin:github/recommended", "plugin:prettier/recommended"],
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2020,
|
||||||
|
"sourceType": "module",
|
||||||
|
"extraFileExtensions": [".mjs"],
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"impliedStrict": true
|
||||||
|
},
|
||||||
|
"project": "./tsconfig.json"
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"node": true,
|
||||||
|
"es6": true,
|
||||||
|
"jest/globals": true,
|
||||||
|
"es2020": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
// Error out for code formatting errors
|
||||||
|
"prettier/prettier": "error",
|
||||||
|
// Namespaces or sometimes needed
|
||||||
|
"import/no-namespace": "off",
|
||||||
|
// Properly format comments
|
||||||
|
"spaced-comment": ["error", "always"],
|
||||||
|
"lines-around-comment": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"beforeBlockComment": true,
|
||||||
|
"beforeLineComment": true,
|
||||||
|
"allowBlockStart": true,
|
||||||
|
"allowObjectStart": true,
|
||||||
|
"allowArrayStart": true,
|
||||||
|
"allowClassStart": true,
|
||||||
|
"ignorePattern": "pragma|ts-ignore"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// Mandatory spacing
|
||||||
|
"padding-line-between-statements": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"blankLine": "always",
|
||||||
|
"prev": "*",
|
||||||
|
"next": "return"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"blankLine": "always",
|
||||||
|
"prev": "directive",
|
||||||
|
"next": "*"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"blankLine": "any",
|
||||||
|
"prev": "directive",
|
||||||
|
"next": "directive"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// Enforce camelCase
|
||||||
|
"camelcase": "error",
|
||||||
|
// Allow forOfStatements
|
||||||
|
"no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"],
|
||||||
|
// Continue is viable in forOf loops in generators
|
||||||
|
"no-continue": "off",
|
||||||
|
// From experience, named exports are almost always desired. I got tired of this rule
|
||||||
|
"import/prefer-default-export": "off",
|
||||||
|
// Unused vars are useful to keep method signatures consistent and documented
|
||||||
|
"@typescript-eslint/no-unused-vars": "off",
|
||||||
|
// For this project only use kebab-case
|
||||||
|
"unicorn/filename-case": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"cases": {
|
||||||
|
"kebabCase": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// Allow Array.from(set) mitigate TS2569 which would require '--downlevelIteration'
|
||||||
|
"unicorn/prefer-spread": "off",
|
||||||
|
// Temp disable to prevent mixing changes with other PRs
|
||||||
|
"i18n-text/no-en": "off"
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["jest.setup.js"],
|
||||||
|
"rules": {
|
||||||
|
"import/no-commonjs": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -14,7 +14,9 @@ assignees: ''
|
|||||||
|
|
||||||
<!--Steps to reproduce the behavior:-->
|
<!--Steps to reproduce the behavior:-->
|
||||||
|
|
||||||
- **Expected behavior**
|
-
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
|
||||||
<!--A clear and concise description of what you expected to happen.-->
|
<!--A clear and concise description of what you expected to happen.-->
|
||||||
|
|
||||||
|
|||||||
9
.github/workflows/build-tests-ubuntu.yml
vendored
9
.github/workflows/build-tests-ubuntu.yml
vendored
@@ -9,7 +9,8 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
UNITY_LICENSE: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><root>\n <License
|
UNITY_LICENSE:
|
||||||
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><root>\n <License
|
||||||
id=\"Terms\">\n <MachineBindings>\n <Binding Key=\"1\"
|
id=\"Terms\">\n <MachineBindings>\n <Binding Key=\"1\"
|
||||||
Value=\"576562626572264761624c65526f7578\"/>\n <Binding Key=\"2\"
|
Value=\"576562626572264761624c65526f7578\"/>\n <Binding Key=\"2\"
|
||||||
Value=\"576562626572264761624c65526f7578\"/>\n </MachineBindings>\n <MachineID
|
Value=\"576562626572264761624c65526f7578\"/>\n </MachineBindings>\n <MachineID
|
||||||
@@ -35,7 +36,8 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
buildForAllPlatformsUbuntu:
|
buildForAllPlatformsUbuntu:
|
||||||
name: "${{ matrix.targetPlatform }} on ${{ matrix.unityVersion}}${{startsWith(matrix.buildProfile, 'Assets') && ' (via Build Profile)' || '' }}"
|
name:
|
||||||
|
"${{ matrix.targetPlatform }} on ${{ matrix.unityVersion}}${{startsWith(matrix.buildProfile, 'Assets') && ' (via Build Profile)' || '' }}"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -198,6 +200,7 @@ jobs:
|
|||||||
###########################
|
###########################
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "Build ${{ matrix.targetPlatform }}${{ startsWith(matrix.buildProfile, 'Assets') && ' (via Build Profile)' || '' }} on Ubuntu (${{ matrix.unityVersion }}_il2cpp_${{ matrix.buildWithIl2cpp }}_params_${{ matrix.additionalParameters }})"
|
name:
|
||||||
|
"Build ${{ matrix.targetPlatform }}${{ startsWith(matrix.buildProfile, 'Assets') && ' (via Build Profile)' || '' }} on Ubuntu (${{ matrix.unityVersion }}_il2cpp_${{ matrix.buildWithIl2cpp }}_params_${{ matrix.additionalParameters }})"
|
||||||
path: build
|
path: build
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
|
|||||||
23
.github/workflows/integrity-check.yml
vendored
23
.github/workflows/integrity-check.yml
vendored
@@ -23,31 +23,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install package manager (from package.json)
|
|
||||||
run: |
|
|
||||||
corepack enable
|
|
||||||
corepack install
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: '18'
|
||||||
- name: Resolve yarn cache folder
|
- run: yarn
|
||||||
id: yarn-config
|
|
||||||
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ steps.yarn-config.outputs.cacheFolder }}
|
|
||||||
.yarn/install-state.gz
|
|
||||||
key: yarn-v2-${{ runner.os }}-node-18-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-v2-${{ runner.os }}-node-18-
|
|
||||||
- name: Install deps
|
|
||||||
env:
|
|
||||||
YARN_ENABLE_HARDENED_MODE: 'false'
|
|
||||||
run: |
|
|
||||||
case "$(yarn --version)" in 1.*) echo 'expected up-to-date yarn version'; exit 1 ;; esac
|
|
||||||
yarn install --immutable
|
|
||||||
- run: yarn lint
|
- run: yarn lint
|
||||||
- run: yarn test:ci --coverage
|
- run: yarn test:ci --coverage
|
||||||
- run: bash <(curl -s https://codecov.io/bash)
|
- run: bash <(curl -s https://codecov.io/bash)
|
||||||
|
|||||||
30
.github/workflows/validate-community-plugins.yml
vendored
30
.github/workflows/validate-community-plugins.yml
vendored
@@ -98,12 +98,12 @@ jobs:
|
|||||||
|
|
||||||
# Add git package via manifest
|
# Add git package via manifest
|
||||||
cd test-project
|
cd test-project
|
||||||
python3 -c "
|
cat Packages/manifest.json | python3 -c "
|
||||||
import sys, json
|
import sys, json
|
||||||
manifest = json.load(sys.stdin)
|
manifest = json.load(sys.stdin)
|
||||||
manifest['dependencies']['${{ matrix.name }}'] = '${{ matrix.package }}'
|
manifest['dependencies']['${{ matrix.name }}'] = '${{ matrix.package }}'
|
||||||
json.dump(manifest, sys.stdout, indent=2)
|
json.dump(manifest, sys.stdout, indent=2)
|
||||||
" < Packages/manifest.json > Packages/manifest.tmp && mv Packages/manifest.tmp Packages/manifest.json
|
" > Packages/manifest.tmp && mv Packages/manifest.tmp Packages/manifest.json
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -125,20 +125,18 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
STATUS="${{ steps.build.outcome }}"
|
STATUS="${{ steps.build.outcome }}"
|
||||||
{
|
echo "## ${{ matrix.name }} — ${{ matrix.platform }}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "## ${{ matrix.name }} — ${{ matrix.platform }}"
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo ""
|
if [ "$STATUS" = "success" ]; then
|
||||||
if [ "$STATUS" = "success" ]; then
|
echo "✅ **PASSED** — Compiled and built successfully" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "✅ **PASSED** — Compiled and built successfully"
|
else
|
||||||
else
|
echo "❌ **FAILED** — Build or compilation failed" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "❌ **FAILED** — Build or compilation failed"
|
fi
|
||||||
fi
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo ""
|
echo "- Unity: ${{ matrix.unity }}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- Unity: ${{ matrix.unity }}"
|
echo "- Platform: ${{ matrix.platform }}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- Platform: ${{ matrix.platform }}"
|
echo "- Source: ${{ matrix.source }}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- Source: ${{ matrix.source }}"
|
echo "- Package: \`${{ matrix.package }}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- Package: \`${{ matrix.package }}\`"
|
|
||||||
} >> "$GITHUB_STEP_SUMMARY"
|
|
||||||
|
|
||||||
report:
|
report:
|
||||||
name: Validation Report
|
name: Validation Report
|
||||||
|
|||||||
@@ -63,28 +63,14 @@ jobs:
|
|||||||
repository: game-ci/orchestrator
|
repository: game-ci/orchestrator
|
||||||
path: orchestrator-standalone
|
path: orchestrator-standalone
|
||||||
|
|
||||||
- name: Install package manager (from package.json)
|
- name: Setup Node.js
|
||||||
run: |
|
uses: actions/setup-node@v4
|
||||||
corepack enable
|
|
||||||
corepack install
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Resolve yarn cache folder
|
cache: yarn
|
||||||
id: yarn-config
|
|
||||||
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ steps.yarn-config.outputs.cacheFolder }}
|
|
||||||
.yarn/install-state.gz
|
|
||||||
key: yarn-v2-${{ runner.os }}-node-20-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-v2-${{ runner.os }}-node-20-
|
|
||||||
|
|
||||||
- name: Install unity-builder dependencies
|
- name: Install unity-builder dependencies
|
||||||
run: yarn install --immutable
|
run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build unity-builder
|
- name: Build unity-builder
|
||||||
run: |
|
run: |
|
||||||
@@ -100,7 +86,7 @@ jobs:
|
|||||||
- name: Build and pack orchestrator
|
- name: Build and pack orchestrator
|
||||||
working-directory: orchestrator-standalone
|
working-directory: orchestrator-standalone
|
||||||
run: |
|
run: |
|
||||||
yarn install --immutable
|
yarn install --frozen-lockfile
|
||||||
echo "Building orchestrator..."
|
echo "Building orchestrator..."
|
||||||
npx tsc
|
npx tsc
|
||||||
echo "✓ orchestrator compiles successfully"
|
echo "✓ orchestrator compiles successfully"
|
||||||
@@ -174,25 +160,11 @@ jobs:
|
|||||||
repository: game-ci/orchestrator
|
repository: game-ci/orchestrator
|
||||||
lfs: false
|
lfs: false
|
||||||
|
|
||||||
- name: Install package manager (from package.json)
|
- name: Setup Node.js
|
||||||
run: |
|
uses: actions/setup-node@v4
|
||||||
corepack enable
|
|
||||||
corepack install
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Resolve yarn cache folder
|
cache: yarn
|
||||||
id: yarn-config
|
|
||||||
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ steps.yarn-config.outputs.cacheFolder }}
|
|
||||||
.yarn/install-state.gz
|
|
||||||
key: yarn-v2-${{ runner.os }}-node-20-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-v2-${{ runner.os }}-node-20-
|
|
||||||
|
|
||||||
- name: Set up kubectl
|
- name: Set up kubectl
|
||||||
uses: azure/setup-kubectl@v4
|
uses: azure/setup-kubectl@v4
|
||||||
@@ -295,20 +267,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Create S3 bucket for tests
|
- name: Create S3 bucket for tests
|
||||||
run: |
|
run: |
|
||||||
for _ in {1..10}; do
|
for i in {1..10}; do
|
||||||
if curl -s http://localhost:4566/_localstack/health > /dev/null 2>&1; then break; fi
|
if curl -s http://localhost:4566/_localstack/health > /dev/null 2>&1; then break; fi
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
for _ in {1..5}; do
|
for i in {1..5}; do
|
||||||
if command -v awslocal > /dev/null 2>&1; then
|
if command -v awslocal > /dev/null 2>&1; then
|
||||||
awslocal s3 mb s3://"$AWS_STACK_NAME" 2>&1 && break
|
awslocal s3 mb s3://$AWS_STACK_NAME 2>&1 && break
|
||||||
else
|
else
|
||||||
aws --endpoint-url=http://localhost:4566 s3 mb s3://"$AWS_STACK_NAME" 2>&1 && break
|
aws --endpoint-url=http://localhost:4566 s3 mb s3://$AWS_STACK_NAME 2>&1 && break
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
- run: yarn install --immutable
|
- run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build orchestrator
|
- name: Build orchestrator
|
||||||
run: |
|
run: |
|
||||||
@@ -342,7 +314,7 @@ jobs:
|
|||||||
--network orchestrator-net \
|
--network orchestrator-net \
|
||||||
--wait
|
--wait
|
||||||
kubectl config current-context | cat
|
kubectl config current-context | cat
|
||||||
echo "LOCALSTACK_IP=$LOCALSTACK_IP" >> "$GITHUB_ENV"
|
echo "LOCALSTACK_IP=$LOCALSTACK_IP" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Verify cluster readiness and MiniStack connectivity
|
- name: Verify cluster readiness and MiniStack connectivity
|
||||||
timeout-minutes: 2
|
timeout-minutes: 2
|
||||||
@@ -355,15 +327,15 @@ jobs:
|
|||||||
kubectl get nodes
|
kubectl get nodes
|
||||||
LOCALSTACK_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' localstack-main 2>/dev/null || echo "")
|
LOCALSTACK_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' localstack-main 2>/dev/null || echo "")
|
||||||
kubectl run test-localstack --image=curlimages/curl --rm -i --restart=Never --timeout=30s -- \
|
kubectl run test-localstack --image=curlimages/curl --rm -i --restart=Never --timeout=30s -- \
|
||||||
curl -v --max-time 10 http://"${LOCALSTACK_IP}":4566/_localstack/health 2>&1 | head -30 || \
|
curl -v --max-time 10 http://${LOCALSTACK_IP}:4566/_localstack/health 2>&1 | head -30 || \
|
||||||
echo "Cluster connectivity test - MiniStack may not be accessible from k3d"
|
echo "Cluster connectivity test - MiniStack may not be accessible from k3d"
|
||||||
|
|
||||||
- name: Clean up K8s resources before tests
|
- name: Clean up K8s resources before tests
|
||||||
run: |
|
run: |
|
||||||
source /tmp/cleanup-functions.sh
|
source /tmp/cleanup-functions.sh
|
||||||
k8s_resource_cleanup
|
k8s_resource_cleanup
|
||||||
for _ in {1..30}; do
|
for i in {1..30}; do
|
||||||
PVC_COUNT=$(kubectl get pvc -n default 2>/dev/null | grep -c "unity-builder-pvc-" || echo "0")
|
PVC_COUNT=$(kubectl get pvc -n default 2>/dev/null | grep "unity-builder-pvc-" | wc -l || echo "0")
|
||||||
if [ "$PVC_COUNT" -eq 0 ]; then echo "All PVCs deleted"; break; fi
|
if [ "$PVC_COUNT" -eq 0 ]; then echo "All PVCs deleted"; break; fi
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
@@ -567,25 +539,11 @@ jobs:
|
|||||||
repository: game-ci/orchestrator
|
repository: game-ci/orchestrator
|
||||||
lfs: false
|
lfs: false
|
||||||
|
|
||||||
- name: Install package manager (from package.json)
|
- name: Setup Node.js
|
||||||
run: |
|
uses: actions/setup-node@v4
|
||||||
corepack enable
|
|
||||||
corepack install
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Resolve yarn cache folder
|
cache: yarn
|
||||||
id: yarn-config
|
|
||||||
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ steps.yarn-config.outputs.cacheFolder }}
|
|
||||||
.yarn/install-state.gz
|
|
||||||
key: yarn-v2-${{ runner.os }}-node-20-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-v2-${{ runner.os }}-node-20-
|
|
||||||
|
|
||||||
- name: Define cleanup functions
|
- name: Define cleanup functions
|
||||||
run: |
|
run: |
|
||||||
@@ -630,16 +588,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Create S3 bucket for tests
|
- name: Create S3 bucket for tests
|
||||||
run: |
|
run: |
|
||||||
for _ in {1..5}; do
|
for i in {1..5}; do
|
||||||
if command -v awslocal > /dev/null 2>&1; then
|
if command -v awslocal > /dev/null 2>&1; then
|
||||||
awslocal s3 mb s3://"$AWS_STACK_NAME" 2>&1 && break
|
awslocal s3 mb s3://$AWS_STACK_NAME 2>&1 && break
|
||||||
else
|
else
|
||||||
aws --endpoint-url=http://localhost:4566 s3 mb s3://"$AWS_STACK_NAME" 2>&1 && break
|
aws --endpoint-url=http://localhost:4566 s3 mb s3://$AWS_STACK_NAME 2>&1 && break
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
- run: yarn install --immutable
|
- run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build orchestrator
|
- name: Build orchestrator
|
||||||
run: |
|
run: |
|
||||||
@@ -872,25 +830,11 @@ jobs:
|
|||||||
repository: game-ci/orchestrator
|
repository: game-ci/orchestrator
|
||||||
lfs: false
|
lfs: false
|
||||||
|
|
||||||
- name: Install package manager (from package.json)
|
- name: Setup Node.js
|
||||||
run: |
|
uses: actions/setup-node@v4
|
||||||
corepack enable
|
|
||||||
corepack install
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Resolve yarn cache folder
|
cache: yarn
|
||||||
id: yarn-config
|
|
||||||
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ steps.yarn-config.outputs.cacheFolder }}
|
|
||||||
.yarn/install-state.gz
|
|
||||||
key: yarn-v2-${{ runner.os }}-node-20-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-v2-${{ runner.os }}-node-20-
|
|
||||||
|
|
||||||
- name: Define cleanup functions
|
- name: Define cleanup functions
|
||||||
run: |
|
run: |
|
||||||
@@ -935,16 +879,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Create S3 bucket for tests
|
- name: Create S3 bucket for tests
|
||||||
run: |
|
run: |
|
||||||
for _ in {1..5}; do
|
for i in {1..5}; do
|
||||||
if command -v awslocal > /dev/null 2>&1; then
|
if command -v awslocal > /dev/null 2>&1; then
|
||||||
awslocal s3 mb s3://"$AWS_STACK_NAME" 2>&1 && break
|
awslocal s3 mb s3://$AWS_STACK_NAME 2>&1 && break
|
||||||
else
|
else
|
||||||
aws --endpoint-url=http://localhost:4566 s3 mb s3://"$AWS_STACK_NAME" 2>&1 && break
|
aws --endpoint-url=http://localhost:4566 s3 mb s3://$AWS_STACK_NAME 2>&1 && break
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
- run: yarn install --immutable
|
- run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build orchestrator
|
- name: Build orchestrator
|
||||||
run: |
|
run: |
|
||||||
@@ -1151,25 +1095,11 @@ jobs:
|
|||||||
repository: game-ci/orchestrator
|
repository: game-ci/orchestrator
|
||||||
lfs: false
|
lfs: false
|
||||||
|
|
||||||
- name: Install package manager (from package.json)
|
- name: Setup Node.js
|
||||||
run: |
|
uses: actions/setup-node@v4
|
||||||
corepack enable
|
|
||||||
corepack install
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Resolve yarn cache folder
|
cache: yarn
|
||||||
id: yarn-config
|
|
||||||
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ steps.yarn-config.outputs.cacheFolder }}
|
|
||||||
.yarn/install-state.gz
|
|
||||||
key: yarn-v2-${{ runner.os }}-node-20-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-v2-${{ runner.os }}-node-20-
|
|
||||||
|
|
||||||
- name: Initial disk space cleanup
|
- name: Initial disk space cleanup
|
||||||
run: |
|
run: |
|
||||||
@@ -1201,16 +1131,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Create S3 bucket for tests
|
- name: Create S3 bucket for tests
|
||||||
run: |
|
run: |
|
||||||
for _ in {1..5}; do
|
for i in {1..5}; do
|
||||||
if command -v awslocal > /dev/null 2>&1; then
|
if command -v awslocal > /dev/null 2>&1; then
|
||||||
awslocal s3 mb s3://"$AWS_STACK_NAME" 2>&1 && break
|
awslocal s3 mb s3://$AWS_STACK_NAME 2>&1 && break
|
||||||
else
|
else
|
||||||
aws --endpoint-url=http://localhost:4566 s3 mb s3://"$AWS_STACK_NAME" 2>&1 && break
|
aws --endpoint-url=http://localhost:4566 s3 mb s3://$AWS_STACK_NAME 2>&1 && break
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
- run: yarn install --immutable
|
- run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build orchestrator
|
- name: Build orchestrator
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
32
.github/workflows/validate-orchestrator.yml
vendored
32
.github/workflows/validate-orchestrator.yml
vendored
@@ -83,33 +83,15 @@ jobs:
|
|||||||
repository: game-ci/orchestrator
|
repository: game-ci/orchestrator
|
||||||
path: orchestrator-standalone
|
path: orchestrator-standalone
|
||||||
|
|
||||||
- name: Install package manager (from package.json)
|
- name: Setup Node.js
|
||||||
run: |
|
uses: actions/setup-node@v4
|
||||||
corepack enable
|
|
||||||
corepack install
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Resolve yarn cache folder
|
cache: yarn
|
||||||
id: yarn-config
|
|
||||||
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ steps.yarn-config.outputs.cacheFolder }}
|
|
||||||
.yarn/install-state.gz
|
|
||||||
key: yarn-v2-${{ runner.os }}-node-20-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-v2-${{ runner.os }}-node-20-
|
|
||||||
|
|
||||||
# --- unity-builder compilation and tests ---
|
# --- unity-builder compilation and tests ---
|
||||||
- name: Install unity-builder dependencies
|
- name: Install unity-builder dependencies
|
||||||
env:
|
run: yarn install --frozen-lockfile
|
||||||
YARN_ENABLE_HARDENED_MODE: 'false'
|
|
||||||
run: |
|
|
||||||
case "$(yarn --version)" in 1.*) echo 'expected up-to-date yarn version'; exit 1 ;; esac
|
|
||||||
yarn install --immutable
|
|
||||||
|
|
||||||
- name: Build unity-builder
|
- name: Build unity-builder
|
||||||
run: |
|
run: |
|
||||||
@@ -120,7 +102,7 @@ jobs:
|
|||||||
- name: Run orchestrator-plugin unit tests
|
- name: Run orchestrator-plugin unit tests
|
||||||
run: |
|
run: |
|
||||||
echo "Running orchestrator-plugin unit tests..."
|
echo "Running orchestrator-plugin unit tests..."
|
||||||
yarn vitest run orchestrator-plugin
|
npx jest orchestrator-plugin --verbose --detectOpenHandles --forceExit
|
||||||
|
|
||||||
# --- Plugin loader without orchestrator ---
|
# --- Plugin loader without orchestrator ---
|
||||||
- name: Verify plugin loader returns undefined without orchestrator
|
- name: Verify plugin loader returns undefined without orchestrator
|
||||||
@@ -151,7 +133,7 @@ jobs:
|
|||||||
- name: Build and pack orchestrator
|
- name: Build and pack orchestrator
|
||||||
working-directory: orchestrator-standalone
|
working-directory: orchestrator-standalone
|
||||||
run: |
|
run: |
|
||||||
yarn install --immutable
|
yarn install --frozen-lockfile
|
||||||
echo "Building orchestrator..."
|
echo "Building orchestrator..."
|
||||||
npx tsc
|
npx tsc
|
||||||
echo "✓ orchestrator compiles successfully"
|
echo "✓ orchestrator compiles successfully"
|
||||||
@@ -162,7 +144,7 @@ jobs:
|
|||||||
working-directory: orchestrator-standalone
|
working-directory: orchestrator-standalone
|
||||||
run: |
|
run: |
|
||||||
echo "Running orchestrator unit tests..."
|
echo "Running orchestrator unit tests..."
|
||||||
yarn vitest run 2>&1 | tail -30
|
npx jest --no-cache 2>&1 | tail -20
|
||||||
|
|
||||||
# --- Plugin loader with orchestrator installed ---
|
# --- Plugin loader with orchestrator installed ---
|
||||||
- name: Install orchestrator into unity-builder
|
- name: Install orchestrator into unity-builder
|
||||||
|
|||||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -7,12 +7,3 @@ yarn-error.log
|
|||||||
.orig
|
.orig
|
||||||
$LOG_FILE
|
$LOG_FILE
|
||||||
temp/
|
temp/
|
||||||
|
|
||||||
# yarn 4 (berry)
|
|
||||||
.pnp.*
|
|
||||||
.yarn/*
|
|
||||||
!.yarn/patches
|
|
||||||
!.yarn/plugins
|
|
||||||
!.yarn/releases
|
|
||||||
!.yarn/sdks
|
|
||||||
!.yarn/versions
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
yarn lint-staged
|
|
||||||
yarn typecheck
|
|
||||||
|
|
||||||
if command -v gitleaks >/dev/null 2>&1; then
|
|
||||||
gitleaks protect --staged --no-banner --redact
|
|
||||||
fi
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"semi": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"trailingComma": "all",
|
|
||||||
"printWidth": 100,
|
|
||||||
"proseWrap": "preserve",
|
|
||||||
"sortPackageJson": false,
|
|
||||||
"ignorePatterns": [
|
|
||||||
"**/node_modules/**",
|
|
||||||
"**/dist/**",
|
|
||||||
"**/coverage/**",
|
|
||||||
"**/.yarn/**",
|
|
||||||
"default-build-script/**",
|
|
||||||
"test-runner/**",
|
|
||||||
"platforms/**"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
||||||
"plugins": ["typescript", "vitest", "unicorn", "oxc"],
|
|
||||||
"categories": {
|
|
||||||
"correctness": "error",
|
|
||||||
"suspicious": "error",
|
|
||||||
"perf": "error"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"vitest/require-mock-type-parameters": "off",
|
|
||||||
"vitest/valid-title": "off",
|
|
||||||
"vitest/valid-describe-callback": "off",
|
|
||||||
"vitest/expect-expect": "off",
|
|
||||||
"vitest/no-conditional-tests": "off",
|
|
||||||
"vitest/no-conditional-expect": "off",
|
|
||||||
"vitest/require-to-throw-message": "off",
|
|
||||||
"vitest/no-disabled-tests": "warn",
|
|
||||||
"unicorn/prefer-array-flat-map": "warn",
|
|
||||||
"typescript/no-explicit-any": "warn",
|
|
||||||
"typescript/ban-ts-comment": "off",
|
|
||||||
"typescript/no-namespace": "off",
|
|
||||||
"typescript/no-extraneous-class": "off",
|
|
||||||
"no-bitwise": "off",
|
|
||||||
"no-shadow": "off",
|
|
||||||
"no-await-in-loop": "off",
|
|
||||||
"no-underscore-dangle": "off",
|
|
||||||
"unicorn/no-array-sort": "off",
|
|
||||||
"unicorn/prefer-set-has": "off",
|
|
||||||
"unicorn/consistent-function-scoping": "off",
|
|
||||||
"unicorn/no-useless-spread": "warn",
|
|
||||||
"eslint/preserve-caught-error": "warn",
|
|
||||||
"oxc/no-map-spread": "warn"
|
|
||||||
},
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": ["**/*.test.ts", "**/*.spec.ts"],
|
|
||||||
"rules": {
|
|
||||||
"typescript/no-explicit-any": "off",
|
|
||||||
"no-unused-vars": "off"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"env": {
|
|
||||||
"browser": false,
|
|
||||||
"node": true,
|
|
||||||
"es2024": true,
|
|
||||||
"vitest/globals": true
|
|
||||||
},
|
|
||||||
"ignorePatterns": [
|
|
||||||
"**/node_modules/**",
|
|
||||||
"**/dist/**",
|
|
||||||
"**/coverage/**",
|
|
||||||
"**/.yarn/**",
|
|
||||||
"default-build-script/**",
|
|
||||||
"test-runner/**",
|
|
||||||
"platforms/**"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
2
.prettierignore
Normal file
2
.prettierignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
**/node_modules/**
|
||||||
|
**/dist/**
|
||||||
7
.prettierrc.json
Normal file
7
.prettierrc.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"printWidth": 120,
|
||||||
|
"proseWrap": "always"
|
||||||
|
}
|
||||||
3
.yarnrc
Normal file
3
.yarnrc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
save-prefix "^"
|
||||||
|
--install.audit true
|
||||||
|
--add.audit true
|
||||||
10
.yarnrc.yml
10
.yarnrc.yml
@@ -1,10 +0,0 @@
|
|||||||
approvedGitRepositories:
|
|
||||||
- '**'
|
|
||||||
|
|
||||||
compressionLevel: mixed
|
|
||||||
|
|
||||||
enableGlobalCache: false
|
|
||||||
|
|
||||||
enableHardenedMode: false
|
|
||||||
|
|
||||||
nodeLinker: node-modules
|
|
||||||
13
action.yml
13
action.yml
@@ -9,7 +9,8 @@ inputs:
|
|||||||
unityVersion:
|
unityVersion:
|
||||||
required: false
|
required: false
|
||||||
default: 'auto'
|
default: 'auto'
|
||||||
description: 'Version of unity to use for building the project. Use "auto" to get from your ProjectSettings/ProjectVersion.txt'
|
description:
|
||||||
|
'Version of unity to use for building the project. Use "auto" to get from your ProjectSettings/ProjectVersion.txt'
|
||||||
customImage:
|
customImage:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
@@ -123,7 +124,8 @@ inputs:
|
|||||||
chownFilesTo:
|
chownFilesTo:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
description: 'User and optionally group (user or user:group or uid:gid) to give ownership of the resulting build artifacts'
|
description:
|
||||||
|
'User and optionally group (user or user:group or uid:gid) to give ownership of the resulting build artifacts'
|
||||||
dockerCpuLimit:
|
dockerCpuLimit:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
@@ -178,11 +180,6 @@ inputs:
|
|||||||
default: 'false'
|
default: 'false'
|
||||||
required: false
|
required: false
|
||||||
description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.'
|
description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.'
|
||||||
linux64RemoveExecutableExtension:
|
|
||||||
default: 'false'
|
|
||||||
required: false
|
|
||||||
description:
|
|
||||||
'When building for StandaloneLinux64, remove the default file extension of `.x86_64`. Set to true to restore the extensionless behavior from v4.'
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
volume:
|
volume:
|
||||||
@@ -200,5 +197,5 @@ branding:
|
|||||||
icon: 'box'
|
icon: 'box'
|
||||||
color: 'gray-dark'
|
color: 'gray-dark'
|
||||||
runs:
|
runs:
|
||||||
using: 'node24'
|
using: 'node20'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|||||||
122573
dist/index.js
generated
vendored
122573
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
779
dist/licenses.txt
generated
vendored
779
dist/licenses.txt
generated
vendored
@@ -110,9 +110,9 @@ SOFTWARE.
|
|||||||
|
|
||||||
@azure/core-auth
|
@azure/core-auth
|
||||||
MIT
|
MIT
|
||||||
Copyright (c) Microsoft Corporation.
|
The MIT License (MIT)
|
||||||
|
|
||||||
MIT License
|
Copyright (c) 2020 Microsoft
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -124,7 +124,7 @@ furnished to do so, subject to the following conditions:
|
|||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
@@ -133,11 +133,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
@azure/core-client
|
@azure/core-http
|
||||||
MIT
|
MIT
|
||||||
Copyright (c) Microsoft Corporation.
|
The MIT License (MIT)
|
||||||
|
|
||||||
MIT License
|
Copyright (c) 2020 Microsoft
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -149,32 +149,7 @@ furnished to do so, subject to the following conditions:
|
|||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@azure/core-http-compat
|
|
||||||
MIT
|
|
||||||
Copyright (c) Microsoft Corporation.
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
@@ -208,11 +183,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
@azure/core-rest-pipeline
|
@azure/core-paging
|
||||||
MIT
|
MIT
|
||||||
Copyright (c) Microsoft Corporation.
|
The MIT License (MIT)
|
||||||
|
|
||||||
MIT License
|
Copyright (c) 2020 Microsoft
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -224,7 +199,7 @@ furnished to do so, subject to the following conditions:
|
|||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
@@ -235,9 +210,9 @@ SOFTWARE.
|
|||||||
|
|
||||||
@azure/core-tracing
|
@azure/core-tracing
|
||||||
MIT
|
MIT
|
||||||
Copyright (c) Microsoft Corporation.
|
The MIT License (MIT)
|
||||||
|
|
||||||
MIT License
|
Copyright (c) 2020 Microsoft
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -249,7 +224,7 @@ furnished to do so, subject to the following conditions:
|
|||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
@@ -260,9 +235,9 @@ SOFTWARE.
|
|||||||
|
|
||||||
@azure/core-util
|
@azure/core-util
|
||||||
MIT
|
MIT
|
||||||
Copyright (c) Microsoft Corporation.
|
The MIT License (MIT)
|
||||||
|
|
||||||
MIT License
|
Copyright (c) 2020 Microsoft
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -274,32 +249,7 @@ furnished to do so, subject to the following conditions:
|
|||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@azure/core-xml
|
|
||||||
MIT
|
|
||||||
Copyright (c) Microsoft Corporation.
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
@@ -310,9 +260,9 @@ SOFTWARE.
|
|||||||
|
|
||||||
@azure/logger
|
@azure/logger
|
||||||
MIT
|
MIT
|
||||||
Copyright (c) Microsoft Corporation.
|
The MIT License (MIT)
|
||||||
|
|
||||||
MIT License
|
Copyright (c) 2020 Microsoft
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -324,7 +274,7 @@ furnished to do so, subject to the following conditions:
|
|||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
@@ -335,34 +285,9 @@ SOFTWARE.
|
|||||||
|
|
||||||
@azure/storage-blob
|
@azure/storage-blob
|
||||||
MIT
|
MIT
|
||||||
Copyright (c) Microsoft Corporation.
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@azure/storage-common
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2018 Microsoft
|
Copyright (c) 2020 Microsoft
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -382,27 +307,211 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
@fastify/busboy
|
|
||||||
MIT
|
|
||||||
Copyright Brian White. All rights reserved.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
@opentelemetry/api
|
||||||
of this software and associated documentation files (the "Software"), to
|
Apache-2.0
|
||||||
deal in the Software without restriction, including without limitation the
|
Apache License
|
||||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
Version 2.0, January 2004
|
||||||
sell copies of the Software, and to permit persons to whom the Software is
|
http://www.apache.org/licenses/
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
||||||
IN THE SOFTWARE.
|
|
||||||
|
|
||||||
@protobuf-ts/runtime
|
@protobuf-ts/runtime
|
||||||
(Apache-2.0 AND BSD-3-Clause)
|
(Apache-2.0 AND BSD-3-Clause)
|
||||||
@@ -760,11 +869,21 @@ Apache-2.0
|
|||||||
of your accepting any such warranty or additional liability.
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
|
||||||
@typespec/ts-http-runtime
|
@vercel/ncc
|
||||||
MIT
|
MIT
|
||||||
Copyright (c) Microsoft Corporation.
|
Copyright 2018 ZEIT, Inc.
|
||||||
|
|
||||||
MIT License
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
asynckit
|
||||||
|
MIT
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2016 Alex Indigo
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -776,7 +895,7 @@ furnished to do so, subject to the following conditions:
|
|||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
@@ -785,41 +904,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
@vercel/ncc
|
|
||||||
MIT
|
|
||||||
Copyright 2018 ZEIT, Inc.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
agent-base
|
|
||||||
MIT
|
|
||||||
(The MIT License)
|
|
||||||
|
|
||||||
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
'Software'), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
balanced-match
|
balanced-match
|
||||||
MIT
|
MIT
|
||||||
(MIT)
|
(MIT)
|
||||||
@@ -870,6 +954,29 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
combined-stream
|
||||||
|
MIT
|
||||||
|
Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
commander
|
commander
|
||||||
MIT
|
MIT
|
||||||
(The MIT License)
|
(The MIT License)
|
||||||
@@ -962,35 +1069,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
debug
|
delayed-stream
|
||||||
MIT
|
MIT
|
||||||
(The MIT License)
|
Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
|
||||||
|
|
||||||
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
|
||||||
Copyright (c) 2018-2021 Josh Junon
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
||||||
and associated documentation files (the 'Software'), to deal in the Software without restriction,
|
|
||||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
||||||
portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
||||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fast-xml-parser
|
|
||||||
MIT
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2017 Amit Kumar Gupta
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -999,16 +1080,42 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in
|
||||||
copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
dot-object
|
||||||
|
MIT
|
||||||
|
|
||||||
|
form-data
|
||||||
|
MIT
|
||||||
|
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
graphql
|
graphql
|
||||||
@@ -1061,71 +1168,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
has-flag
|
lru-cache
|
||||||
MIT
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
http-proxy-agent
|
|
||||||
MIT
|
|
||||||
(The MIT License)
|
|
||||||
|
|
||||||
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
'Software'), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
https-proxy-agent
|
|
||||||
MIT
|
|
||||||
(The MIT License)
|
|
||||||
|
|
||||||
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
'Software'), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
minimatch
|
|
||||||
ISC
|
ISC
|
||||||
The ISC License
|
The ISC License
|
||||||
|
|
||||||
@@ -1144,29 +1187,77 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
ms
|
mime-db
|
||||||
MIT
|
MIT
|
||||||
The MIT License (MIT)
|
(The MIT License)
|
||||||
|
|
||||||
Copyright (c) 2020 Vercel, Inc.
|
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||||
|
Copyright (c) 2015-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
a copy of this software and associated documentation files (the
|
||||||
in the Software without restriction, including without limitation the rights
|
'Software'), to deal in the Software without restriction, including
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
furnished to do so, subject to the following conditions:
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be
|
||||||
copies or substantial portions of the Software.
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
SOFTWARE.
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
mime-types
|
||||||
|
MIT
|
||||||
|
(The MIT License)
|
||||||
|
|
||||||
|
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||||
|
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
'Software'), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
minimatch
|
||||||
|
ISC
|
||||||
|
The ISC License
|
||||||
|
|
||||||
|
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
nanoid
|
nanoid
|
||||||
@@ -1277,7 +1368,7 @@ If the Work includes a "NOTICE" text file as part of its distribution, then any
|
|||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
semver
|
sax
|
||||||
ISC
|
ISC
|
||||||
The ISC License
|
The ISC License
|
||||||
|
|
||||||
@@ -1295,18 +1386,50 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
====
|
||||||
|
|
||||||
supports-color
|
`String.fromCodePoint` by Mathias Bynens used according to terms of MIT
|
||||||
MIT
|
License, as follows:
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
semver
|
||||||
|
ISC
|
||||||
|
The ISC License
|
||||||
|
|
||||||
|
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
tr46
|
tr46
|
||||||
@@ -1352,30 +1475,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
undici
|
twirp-ts
|
||||||
MIT
|
MIT
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) Matteo Collina and Undici contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
unity-changeset
|
unity-changeset
|
||||||
MIT
|
MIT
|
||||||
@@ -1402,6 +1503,19 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
uuid
|
||||||
|
MIT
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
webidl-conversions
|
webidl-conversions
|
||||||
BSD-2-Clause
|
BSD-2-Clause
|
||||||
# The BSD 2-Clause License
|
# The BSD 2-Clause License
|
||||||
@@ -1443,6 +1557,73 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
xml2js
|
||||||
|
MIT
|
||||||
|
Copyright 2010, 2011, 2012, 2013. All rights reserved.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to
|
||||||
|
deal in the Software without restriction, including without limitation the
|
||||||
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
xmlbuilder
|
||||||
|
MIT
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013 Ozgur Ozcitak
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
yallist
|
||||||
|
ISC
|
||||||
|
The ISC License
|
||||||
|
|
||||||
|
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
yaml
|
yaml
|
||||||
ISC
|
ISC
|
||||||
Copyright Eemeli Aro <eemeli@gmail.com>
|
Copyright Eemeli Aro <eemeli@gmail.com>
|
||||||
|
|||||||
11
jest.ci.config.js
Normal file
11
jest.ci.config.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
const base = require('./jest.config.js');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
...base,
|
||||||
|
forceExit: true,
|
||||||
|
detectOpenHandles: true,
|
||||||
|
testTimeout: 120000,
|
||||||
|
maxWorkers: 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
30
jest.config.js
Normal file
30
jest.config.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
module.exports = {
|
||||||
|
// Automatically clear mock calls and instances between every test
|
||||||
|
clearMocks: true,
|
||||||
|
|
||||||
|
// An array of file extensions your modules use
|
||||||
|
moduleFileExtensions: ['js', 'ts'],
|
||||||
|
|
||||||
|
// The test environment that will be used for testing
|
||||||
|
testEnvironment: 'node',
|
||||||
|
|
||||||
|
// The glob patterns Jest uses to detect test files
|
||||||
|
testMatch: ['**/*.test.ts'],
|
||||||
|
|
||||||
|
// This option allows use of a custom test runner
|
||||||
|
testRunner: 'jest-circus/runner',
|
||||||
|
|
||||||
|
// A map with regular expressions for transformers to paths
|
||||||
|
transform: {
|
||||||
|
'^.+\\.ts$': 'ts-jest',
|
||||||
|
},
|
||||||
|
|
||||||
|
// Indicates whether each individual test should be reported during the run
|
||||||
|
verbose: true,
|
||||||
|
|
||||||
|
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
||||||
|
modulePathIgnorePatterns: ['<rootDir>/lib/', '<rootDir>/dist/'],
|
||||||
|
|
||||||
|
// Use jest.setup.js to polyfill fetch for all tests
|
||||||
|
setupFiles: ['<rootDir>/jest.setup.js'],
|
||||||
|
};
|
||||||
31
lefthook.yml
Normal file
31
lefthook.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# EXAMPLE USAGE
|
||||||
|
# Refer for explanation to following link:
|
||||||
|
# https://github.com/evilmartians/lefthook/blob/master/docs/full_guide.md
|
||||||
|
#
|
||||||
|
|
||||||
|
color: true
|
||||||
|
extends: {}
|
||||||
|
|
||||||
|
pre-commit:
|
||||||
|
parallel: true
|
||||||
|
commands:
|
||||||
|
format documents:
|
||||||
|
glob: '*.{md,mdx}'
|
||||||
|
run: yarn prettier --write {staged_files}
|
||||||
|
format configs:
|
||||||
|
glob: '*.{json,yml,yaml}'
|
||||||
|
run: yarn prettier --write {staged_files}
|
||||||
|
format code:
|
||||||
|
glob: '*.{js,jsx,ts,tsx}'
|
||||||
|
exclude: 'dist/'
|
||||||
|
run: yarn prettier --write {staged_files} && yarn eslint {staged_files} && git add {staged_files}
|
||||||
|
run tests:
|
||||||
|
glob: '*.{js,jsx,ts,tsx}'
|
||||||
|
exclude: 'dist/'
|
||||||
|
run: yarn jest --passWithNoTests --findRelatedTests {staged_files}
|
||||||
|
build distributables:
|
||||||
|
skip: ['merge', 'rebase']
|
||||||
|
run: yarn build && git add dist
|
||||||
|
make shell script executable:
|
||||||
|
glob: '*.sh'
|
||||||
|
run: git update-index --chmod=+x
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[tools]
|
|
||||||
node = "20.18.0"
|
|
||||||
yarn = "4.14.1"
|
|
||||||
actionlint = "latest"
|
|
||||||
shellcheck = "latest"
|
|
||||||
gitleaks = "latest"
|
|
||||||
58
package.json
58
package.json
@@ -7,26 +7,12 @@
|
|||||||
"author": "Webber <webber@takken.io>",
|
"author": "Webber <webber@takken.io>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky",
|
"prepare": "lefthook install",
|
||||||
"build": "yarn && tsc && ncc build lib --source-map --license licenses.txt",
|
"build": "yarn && tsc && ncc build lib --source-map --license licenses.txt",
|
||||||
"test": "node scripts/ensure-husky.mjs && vitest run",
|
"lint": "prettier --check \"src/**/*.{js,ts}\" && eslint src/**/*.ts",
|
||||||
"test:watch": "vitest",
|
"format": "prettier --write \"src/**/*.{js,ts}\"",
|
||||||
"test:ci": "vitest run",
|
"test": "jest",
|
||||||
"coverage": "vitest run --coverage",
|
"test:ci": "jest --config=jest.ci.config.js --runInBand"
|
||||||
"lint": "yarn oxlint --report-unused-disable-directives",
|
|
||||||
"format": "oxfmt --write",
|
|
||||||
"format:check": "oxfmt --check",
|
|
||||||
"typecheck": "tsc --noEmit",
|
|
||||||
"typecheck:tsgo": "tsgo --noEmit",
|
|
||||||
"setup:hooks": "node scripts/ensure-husky.mjs"
|
|
||||||
},
|
|
||||||
"lint-staged": {
|
|
||||||
"*.@(ts|tsx|mts|js|jsx|mjs|cjs)": [
|
|
||||||
"oxlint --fix --quiet",
|
|
||||||
"oxfmt --write"
|
|
||||||
],
|
|
||||||
"*.@(json|jsonc|json5|md|mdx|yaml|yml|css|scss|sass|html|toml)": "oxfmt --write",
|
|
||||||
".github/workflows/*.@(yml|yaml)": "actionlint"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.x"
|
"node": ">=18.x"
|
||||||
@@ -39,38 +25,40 @@
|
|||||||
"commander": "^9.0.0",
|
"commander": "^9.0.0",
|
||||||
"commander-ts": "^0.2.0",
|
"commander-ts": "^0.2.0",
|
||||||
"md5": "^2.3.0",
|
"md5": "^2.3.0",
|
||||||
"nanoid": "^3.3.1",
|
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
|
"nanoid": "^3.3.1",
|
||||||
"semver": "^7.5.2",
|
"semver": "^7.5.2",
|
||||||
"ts-md5": "^1.3.1",
|
"ts-md5": "^1.3.1",
|
||||||
"unity-changeset": "^3.1.0",
|
"unity-changeset": "^3.1.0",
|
||||||
"yaml": "^2.2.2"
|
"yaml": "^2.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/jest": "^27.4.1",
|
||||||
"@types/node": "^17.0.23",
|
"@types/node": "^17.0.23",
|
||||||
"@types/semver": "^7.3.9",
|
"@types/semver": "^7.3.9",
|
||||||
"@typescript/native-preview": "^7.0.0-dev.20260505.1",
|
"@typescript-eslint/parser": "4.8.1",
|
||||||
"@vercel/ncc": "^0.36.1",
|
"@vercel/ncc": "^0.36.1",
|
||||||
"@vitest/coverage-istanbul": "^4.1.5",
|
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^10.3.0",
|
"eslint": "^7.23.0",
|
||||||
"eslint-plugin-unicorn": "^64.0.0",
|
"eslint-config-prettier": "8.1.0",
|
||||||
"husky": "9",
|
"eslint-plugin-github": "^4.1.1",
|
||||||
|
"eslint-plugin-jest": "24.1.3",
|
||||||
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
|
"eslint-plugin-unicorn": "28.0.2",
|
||||||
|
"jest": "^27.5.1",
|
||||||
|
"jest-circus": "^27.5.1",
|
||||||
|
"jest-fail-on-console": "^3.0.2",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"lint-staged": "^16.4.0",
|
"lefthook": "^1.6.1",
|
||||||
"node-fetch": "2",
|
"node-fetch": "2",
|
||||||
"oxfmt": "^0.48.0",
|
"prettier": "^2.5.1",
|
||||||
"oxlint": "^1.63.0",
|
"ts-jest": "^27.1.3",
|
||||||
"ts-node": "10.8.1",
|
"ts-node": "10.8.1",
|
||||||
"typescript": "4.7.4",
|
"typescript": "4.7.4",
|
||||||
"vite": "^7",
|
|
||||||
"vitest": "^4",
|
|
||||||
"yarn-audit-fix": "^9.3.8"
|
"yarn-audit-fix": "^9.3.8"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@4.14.1",
|
"volta": {
|
||||||
"dependenciesMeta": {
|
"node": "20.5.1",
|
||||||
"lefthook": {
|
"yarn": "1.22.19"
|
||||||
"built": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
// Self-heals husky git hooks before local dev workflows.
|
|
||||||
//
|
|
||||||
// Why this exists: Yarn 4 skips lifecycle scripts (`prepare`, `postinstall`) on
|
|
||||||
// no-op installs, so `yarn install --immutable` does NOT reinstall hooks once
|
|
||||||
// `.husky/_/` has been wiped. `.husky/_/` is gitignored, so it is also missing
|
|
||||||
// in fresh worktrees and after `git clean -fdx`. Without this guard, commits
|
|
||||||
// silently skip the pre-commit hook (git treats a missing hook file as "no hook").
|
|
||||||
//
|
|
||||||
// Behaviour: ~20 ms no-op when hooks are already installed. Skipped in CI and
|
|
||||||
// when HUSKY=0. Fails loudly (non-zero exit) on real install errors so the
|
|
||||||
// caller stops before commits are made without hooks.
|
|
||||||
|
|
||||||
import { execSync } from 'node:child_process';
|
|
||||||
import { existsSync } from 'node:fs';
|
|
||||||
|
|
||||||
if (process.env.CI || process.env.HUSKY === '0') process.exit(0);
|
|
||||||
|
|
||||||
const expectedHooksPath = '.husky/_';
|
|
||||||
const sentinelHook = '.husky/_/pre-commit';
|
|
||||||
// husky 9.1+ ships bin.js; husky 9.0 ships bin.mjs. Try both.
|
|
||||||
const huskyBin = ['node_modules/husky/bin.js', 'node_modules/husky/bin.mjs'].find(existsSync);
|
|
||||||
|
|
||||||
let configuredHooksPath = '';
|
|
||||||
try {
|
|
||||||
configuredHooksPath = execSync('git config --get core.hooksPath', {
|
|
||||||
encoding: 'utf8',
|
|
||||||
stdio: ['ignore', 'pipe', 'ignore'],
|
|
||||||
}).trim();
|
|
||||||
} catch {
|
|
||||||
// not a git repo or config unset — fall through and try to install
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configuredHooksPath === expectedHooksPath && existsSync(sentinelHook)) {
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!huskyBin) {
|
|
||||||
// husky not installed yet (yarn install hasn't run) — silent no-op
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('· installing git hooks (husky self-heal)…');
|
|
||||||
try {
|
|
||||||
execSync(`node ${huskyBin}`, { stdio: 'inherit' });
|
|
||||||
} catch (error) {
|
|
||||||
const message = error instanceof Error ? error.message : String(error);
|
|
||||||
console.error(
|
|
||||||
`\n❌ husky install failed: ${message}\n\n` +
|
|
||||||
` git pre-commit hooks are NOT installed; commits will skip lint/format/tests.\n` +
|
|
||||||
` Fix the underlying error above, then run \`yarn setup:hooks\` to retry.\n` +
|
|
||||||
` To bypass this guard temporarily (NOT recommended): HUSKY=0 yarn <cmd>.\n`,
|
|
||||||
);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, beforeEach, afterEach, vi, type Mock } from 'vitest';
|
|
||||||
/**
|
/**
|
||||||
* Integration wiring tests for the plugin lifecycle in index.ts
|
* Integration wiring tests for the plugin lifecycle in index.ts
|
||||||
*
|
*
|
||||||
@@ -10,83 +9,74 @@ import { describe, it, expect, beforeEach, afterEach, vi, type Mock } from 'vite
|
|||||||
* - When providerStrategy is non-local without a plugin, an error is thrown
|
* - When providerStrategy is non-local without a plugin, an error is thrown
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { BuildParameters, Docker } from './model';
|
import { BuildParameters } from './model';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Mock plugin
|
// Mock plugin
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
// `vi.mock` hoists to the top of the module, so any factory references must
|
const mockPlugin = {
|
||||||
// be hoisted with `vi.hoisted` to be defined at mock-evaluation time.
|
initialize: jest.fn().mockResolvedValue(undefined),
|
||||||
const { mockPlugin, mockLoadPlugin } = vi.hoisted(() => {
|
canHandleBuild: jest.fn().mockReturnValue(false),
|
||||||
const plugin = {
|
handleBuild: jest.fn().mockResolvedValue({ exitCode: 0 }),
|
||||||
initialize: vi.fn().mockResolvedValue(undefined),
|
beforeLocalBuild: jest.fn().mockResolvedValue(undefined),
|
||||||
canHandleBuild: vi.fn().mockReturnValue(false),
|
afterLocalBuild: jest.fn().mockResolvedValue(undefined),
|
||||||
handleBuild: vi.fn().mockResolvedValue({ exitCode: 0 }),
|
handlePostBuild: jest.fn().mockResolvedValue(undefined),
|
||||||
beforeLocalBuild: vi.fn().mockResolvedValue(undefined),
|
};
|
||||||
afterLocalBuild: vi.fn().mockResolvedValue(undefined),
|
|
||||||
handlePostBuild: vi.fn().mockResolvedValue(undefined),
|
|
||||||
};
|
|
||||||
return {
|
|
||||||
mockPlugin: plugin,
|
|
||||||
mockLoadPlugin: vi.fn().mockResolvedValue(plugin),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
vi.mock('./model/plugin', () => ({
|
const mockLoadOrchestratorPlugin = jest.fn().mockResolvedValue(mockPlugin);
|
||||||
loadPlugin: mockLoadPlugin,
|
|
||||||
|
jest.mock('./model/orchestrator-plugin', () => ({
|
||||||
|
loadOrchestratorPlugin: mockLoadOrchestratorPlugin,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('@actions/core');
|
jest.mock('@actions/core');
|
||||||
vi.mock('./model', () => ({
|
jest.mock('./model', () => ({
|
||||||
Action: {
|
Action: {
|
||||||
checkCompatibility: vi.fn(),
|
checkCompatibility: jest.fn(),
|
||||||
workspace: '/workspace',
|
workspace: '/workspace',
|
||||||
actionFolder: '/action',
|
actionFolder: '/action',
|
||||||
},
|
},
|
||||||
BuildParameters: {
|
BuildParameters: {
|
||||||
create: vi.fn(),
|
create: jest.fn(),
|
||||||
},
|
},
|
||||||
Cache: {
|
Cache: {
|
||||||
verify: vi.fn(),
|
verify: jest.fn(),
|
||||||
},
|
},
|
||||||
Docker: {
|
Docker: {
|
||||||
run: vi.fn().mockResolvedValue(0),
|
run: jest.fn().mockResolvedValue(0),
|
||||||
},
|
},
|
||||||
// vitest 4 requires constructor mocks to use regular `function` (or
|
ImageTag: jest.fn().mockImplementation(() => ({
|
||||||
// `class`); arrow fns aren't valid constructors.
|
toString: () => 'mock-image:latest',
|
||||||
ImageTag: vi.fn(function () {
|
})),
|
||||||
return { toString: () => 'mock-image:latest' };
|
|
||||||
}),
|
|
||||||
Output: {
|
Output: {
|
||||||
setBuildVersion: vi.fn().mockResolvedValue(''),
|
setBuildVersion: jest.fn().mockResolvedValue(''),
|
||||||
setAndroidVersionCode: vi.fn().mockResolvedValue(''),
|
setAndroidVersionCode: jest.fn().mockResolvedValue(''),
|
||||||
setEngineExitCode: vi.fn().mockResolvedValue(''),
|
setEngineExitCode: jest.fn().mockResolvedValue(''),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('./model/cli/cli', () => ({
|
jest.mock('./model/cli/cli', () => ({
|
||||||
Cli: {
|
Cli: {
|
||||||
InitCliMode: vi.fn().mockReturnValue(false),
|
InitCliMode: jest.fn().mockReturnValue(false),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('./model/mac-builder', () => ({
|
jest.mock('./model/mac-builder', () => ({
|
||||||
__esModule: true,
|
__esModule: true,
|
||||||
default: {
|
default: {
|
||||||
run: vi.fn().mockResolvedValue(0),
|
run: jest.fn().mockResolvedValue(0),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('./model/platform-setup', () => ({
|
jest.mock('./model/platform-setup', () => ({
|
||||||
__esModule: true,
|
__esModule: true,
|
||||||
default: {
|
default: {
|
||||||
setup: vi.fn().mockResolvedValue(''),
|
setup: jest.fn().mockResolvedValue(''),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const mockedBuildParametersCreate = BuildParameters.create as Mock;
|
const mockedBuildParametersCreate = BuildParameters.create as jest.Mock;
|
||||||
|
|
||||||
function createMockBuildParameters(overrides: Record<string, any> = {}) {
|
function createMockBuildParameters(overrides: Record<string, any> = {}) {
|
||||||
return {
|
return {
|
||||||
@@ -105,12 +95,12 @@ function createMockBuildParameters(overrides: Record<string, any> = {}) {
|
|||||||
async function runIndex(overrides: Record<string, any> = {}): Promise<void> {
|
async function runIndex(overrides: Record<string, any> = {}): Promise<void> {
|
||||||
mockedBuildParametersCreate.mockResolvedValue(createMockBuildParameters(overrides));
|
mockedBuildParametersCreate.mockResolvedValue(createMockBuildParameters(overrides));
|
||||||
|
|
||||||
// index.ts exports `runMain` for testability (the file used to rely on
|
return new Promise<void>((resolve) => {
|
||||||
// top-level execution + jest's `vi.isolateModules`, but vitest 4 dropped
|
jest.isolateModules(() => {
|
||||||
// that API). Calling the exported function directly is cleaner than
|
require('./index');
|
||||||
// round-tripping through dynamic imports.
|
});
|
||||||
const { runMain } = await import('./index');
|
setTimeout(resolve, 100);
|
||||||
await runMain();
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -122,14 +112,14 @@ describe('index.ts plugin lifecycle wiring', () => {
|
|||||||
const originalEnvironment = { ...process.env };
|
const originalEnvironment = { ...process.env };
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
process.env.GITHUB_WORKSPACE = '/workspace';
|
process.env.GITHUB_WORKSPACE = '/workspace';
|
||||||
Object.defineProperty(process, 'platform', { value: 'linux' });
|
Object.defineProperty(process, 'platform', { value: 'linux' });
|
||||||
|
|
||||||
// Reset plugin to default behavior
|
// Reset plugin to default behavior
|
||||||
mockPlugin.canHandleBuild.mockReturnValue(false);
|
mockPlugin.canHandleBuild.mockReturnValue(false);
|
||||||
mockPlugin.handleBuild.mockResolvedValue({ exitCode: 0 });
|
mockPlugin.handleBuild.mockResolvedValue({ exitCode: 0 });
|
||||||
mockLoadPlugin.mockResolvedValue(mockPlugin);
|
mockLoadOrchestratorPlugin.mockResolvedValue(mockPlugin);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@@ -142,23 +132,16 @@ describe('index.ts plugin lifecycle wiring', () => {
|
|||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
describe('local build with plugin installed', () => {
|
describe('local build with plugin installed', () => {
|
||||||
it('should call lifecycle hooks in order: initialize -> beforeLocalBuild -> [build] -> afterLocalBuild -> handlePostBuild', async () => {
|
it('should call lifecycle hooks in order: initialize → beforeLocalBuild → [build] → afterLocalBuild → handlePostBuild', async () => {
|
||||||
const callOrder: string[] = [];
|
const callOrder: string[] = [];
|
||||||
mockPlugin.initialize.mockImplementation(async () => callOrder.push('initialize'));
|
mockPlugin.initialize.mockImplementation(async () => callOrder.push('initialize'));
|
||||||
mockPlugin.beforeLocalBuild.mockImplementation(async () =>
|
mockPlugin.beforeLocalBuild.mockImplementation(async () => callOrder.push('beforeLocalBuild'));
|
||||||
callOrder.push('beforeLocalBuild'),
|
|
||||||
);
|
|
||||||
mockPlugin.afterLocalBuild.mockImplementation(async () => callOrder.push('afterLocalBuild'));
|
mockPlugin.afterLocalBuild.mockImplementation(async () => callOrder.push('afterLocalBuild'));
|
||||||
mockPlugin.handlePostBuild.mockImplementation(async () => callOrder.push('handlePostBuild'));
|
mockPlugin.handlePostBuild.mockImplementation(async () => callOrder.push('handlePostBuild'));
|
||||||
|
|
||||||
await runIndex();
|
await runIndex();
|
||||||
|
|
||||||
expect(callOrder).toEqual([
|
expect(callOrder).toEqual(['initialize', 'beforeLocalBuild', 'afterLocalBuild', 'handlePostBuild']);
|
||||||
'initialize',
|
|
||||||
'beforeLocalBuild',
|
|
||||||
'afterLocalBuild',
|
|
||||||
'handlePostBuild',
|
|
||||||
]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should pass buildParameters and workspace to initialize', async () => {
|
it('should pass buildParameters and workspace to initialize', async () => {
|
||||||
@@ -195,6 +178,7 @@ describe('index.ts plugin lifecycle wiring', () => {
|
|||||||
|
|
||||||
describe('plugin handles build (canHandleBuild = true)', () => {
|
describe('plugin handles build (canHandleBuild = true)', () => {
|
||||||
it('should call handleBuild instead of Docker.run', async () => {
|
it('should call handleBuild instead of Docker.run', async () => {
|
||||||
|
const { Docker } = require('./model');
|
||||||
mockPlugin.canHandleBuild.mockReturnValue(true);
|
mockPlugin.canHandleBuild.mockReturnValue(true);
|
||||||
mockPlugin.handleBuild.mockResolvedValue({ exitCode: 0 });
|
mockPlugin.handleBuild.mockResolvedValue({ exitCode: 0 });
|
||||||
|
|
||||||
@@ -222,6 +206,7 @@ describe('index.ts plugin lifecycle wiring', () => {
|
|||||||
|
|
||||||
describe('fallback to local build', () => {
|
describe('fallback to local build', () => {
|
||||||
it('should do a local build when handleBuild returns fallbackToLocal', async () => {
|
it('should do a local build when handleBuild returns fallbackToLocal', async () => {
|
||||||
|
const { Docker } = require('./model');
|
||||||
mockPlugin.canHandleBuild.mockReturnValue(true);
|
mockPlugin.canHandleBuild.mockReturnValue(true);
|
||||||
mockPlugin.handleBuild.mockResolvedValue({ exitCode: -1, fallbackToLocal: true });
|
mockPlugin.handleBuild.mockResolvedValue({ exitCode: -1, fallbackToLocal: true });
|
||||||
|
|
||||||
@@ -240,7 +225,8 @@ describe('index.ts plugin lifecycle wiring', () => {
|
|||||||
|
|
||||||
describe('no plugin installed', () => {
|
describe('no plugin installed', () => {
|
||||||
it('should build locally without errors when providerStrategy is local', async () => {
|
it('should build locally without errors when providerStrategy is local', async () => {
|
||||||
mockLoadPlugin.mockResolvedValue(undefined);
|
const { Docker } = require('./model');
|
||||||
|
mockLoadOrchestratorPlugin.mockResolvedValue(undefined);
|
||||||
|
|
||||||
await runIndex({ providerStrategy: 'local' });
|
await runIndex({ providerStrategy: 'local' });
|
||||||
|
|
||||||
@@ -248,13 +234,12 @@ describe('index.ts plugin lifecycle wiring', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should error when providerStrategy is non-local and no plugin', async () => {
|
it('should error when providerStrategy is non-local and no plugin', async () => {
|
||||||
mockLoadPlugin.mockResolvedValue(undefined);
|
const core = require('@actions/core');
|
||||||
|
mockLoadOrchestratorPlugin.mockResolvedValue(undefined);
|
||||||
|
|
||||||
await runIndex({ providerStrategy: 'aws' });
|
await runIndex({ providerStrategy: 'aws' });
|
||||||
|
|
||||||
expect(core.setFailed).toHaveBeenCalledWith(
|
expect(core.setFailed).toHaveBeenCalledWith(expect.stringContaining('requires @game-ci/orchestrator'));
|
||||||
expect.stringContaining('requires @game-ci/orchestrator'),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -264,15 +249,14 @@ describe('index.ts plugin lifecycle wiring', () => {
|
|||||||
|
|
||||||
describe('plugin installed but canHandleBuild returns false with non-local provider', () => {
|
describe('plugin installed but canHandleBuild returns false with non-local provider', () => {
|
||||||
it('should error when providerStrategy is non-local', async () => {
|
it('should error when providerStrategy is non-local', async () => {
|
||||||
|
const core = require('@actions/core');
|
||||||
mockPlugin.canHandleBuild.mockReturnValue(false);
|
mockPlugin.canHandleBuild.mockReturnValue(false);
|
||||||
|
|
||||||
await runIndex({ providerStrategy: 'aws' });
|
await runIndex({ providerStrategy: 'aws' });
|
||||||
|
|
||||||
// The plugin is initialized but says it can't handle the build,
|
// The plugin is initialized but says it can't handle the build,
|
||||||
// and providerStrategy is not local, so it falls to the error case
|
// and providerStrategy is not local, so it falls to the error case
|
||||||
expect(core.setFailed).toHaveBeenCalledWith(
|
expect(core.setFailed).toHaveBeenCalledWith(expect.stringContaining('requires @game-ci/orchestrator'));
|
||||||
expect.stringContaining('requires @game-ci/orchestrator'),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
19
src/index.ts
19
src/index.ts
@@ -3,11 +3,9 @@ import { Action, BuildParameters, Cache, Docker, ImageTag, Output } from './mode
|
|||||||
import { Cli } from './model/cli/cli';
|
import { Cli } from './model/cli/cli';
|
||||||
import MacBuilder from './model/mac-builder';
|
import MacBuilder from './model/mac-builder';
|
||||||
import PlatformSetup from './model/platform-setup';
|
import PlatformSetup from './model/platform-setup';
|
||||||
import { Plugin, loadPlugin } from './model/plugin';
|
import { loadOrchestratorPlugin, OrchestratorPlugin } from './model/orchestrator-plugin';
|
||||||
|
|
||||||
// Exported so tests can drive the lifecycle directly without depending on
|
async function runMain() {
|
||||||
// vitest's module re-loading (which changed in vitest 4).
|
|
||||||
export async function runMain() {
|
|
||||||
try {
|
try {
|
||||||
if (Cli.InitCliMode()) {
|
if (Cli.InitCliMode()) {
|
||||||
await Cli.RunCli();
|
await Cli.RunCli();
|
||||||
@@ -21,8 +19,8 @@ export async function runMain() {
|
|||||||
const buildParameters = await BuildParameters.create();
|
const buildParameters = await BuildParameters.create();
|
||||||
const baseImage = new ImageTag(buildParameters);
|
const baseImage = new ImageTag(buildParameters);
|
||||||
|
|
||||||
// Load optional plugin. The default implementation is @game-ci/orchestrator.
|
// Load orchestrator plugin (optional — only needed for remote builds and plugin features)
|
||||||
const plugin = await loadPlugin();
|
const plugin = await loadOrchestratorPlugin();
|
||||||
await plugin?.initialize(buildParameters, workspace);
|
await plugin?.initialize(buildParameters, workspace);
|
||||||
|
|
||||||
let exitCode = -1;
|
let exitCode = -1;
|
||||||
@@ -64,7 +62,7 @@ async function runLocalBuild(
|
|||||||
baseImage: ImageTag,
|
baseImage: ImageTag,
|
||||||
workspace: string,
|
workspace: string,
|
||||||
actionFolder: string,
|
actionFolder: string,
|
||||||
plugin?: Plugin,
|
plugin?: OrchestratorPlugin,
|
||||||
): Promise<number> {
|
): Promise<number> {
|
||||||
await plugin?.beforeLocalBuild(workspace);
|
await plugin?.beforeLocalBuild(workspace);
|
||||||
|
|
||||||
@@ -83,9 +81,4 @@ async function runLocalBuild(
|
|||||||
return exitCode;
|
return exitCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto-run when this module is the entry point. Tests import the file via
|
runMain();
|
||||||
// `await import('./index')` purely to register the mock factories and then
|
|
||||||
// call `runMain()` directly.
|
|
||||||
if (process.env.NODE_ENV !== 'test') {
|
|
||||||
runMain();
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import { stat } from 'node:fs/promises';
|
import { stat } from 'node:fs/promises';
|
||||||
|
|
||||||
describe('Integrity tests', () => {
|
describe('Integrity tests', () => {
|
||||||
|
|||||||
9
src/jest.setup.ts
Normal file
9
src/jest.setup.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import failOnConsole from 'jest-fail-on-console';
|
||||||
|
|
||||||
|
// Fail when console logs something inside a test - use spyOn instead
|
||||||
|
failOnConsole({
|
||||||
|
shouldFailOnWarn: true,
|
||||||
|
shouldFailOnError: true,
|
||||||
|
shouldFailOnLog: true,
|
||||||
|
shouldFailOnAssert: true,
|
||||||
|
});
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
import { vi } from 'vitest';
|
|
||||||
// Import this named export into your test file:
|
// Import this named export into your test file:
|
||||||
import Platform from '../platform';
|
import Platform from '../platform';
|
||||||
|
|
||||||
export const mockGetFromUser = vi.fn().mockResolvedValue({
|
export const mockGetFromUser = jest.fn().mockResolvedValue({
|
||||||
editorVersion: '',
|
editorVersion: '',
|
||||||
targetPlatform: Platform.types.Test,
|
targetPlatform: Platform.types.Test,
|
||||||
projectPath: '.',
|
projectPath: '.',
|
||||||
|
|||||||
@@ -1,23 +1,22 @@
|
|||||||
import { vi } from 'vitest';
|
|
||||||
/* eslint unicorn/prevent-abbreviations: "off" */
|
/* eslint unicorn/prevent-abbreviations: "off" */
|
||||||
|
|
||||||
// Import these named export into your test file:
|
// Import these named export into your test file:
|
||||||
export const mockProjectPath = vi.fn().mockResolvedValue('mockProjectPath');
|
export const mockProjectPath = jest.fn().mockResolvedValue('mockProjectPath');
|
||||||
export const mockIsDirtyAllowed = vi.fn().mockResolvedValue(false);
|
export const mockIsDirtyAllowed = jest.fn().mockResolvedValue(false);
|
||||||
export const mockBranch = vi.fn().mockResolvedValue('mockBranch');
|
export const mockBranch = jest.fn().mockResolvedValue('mockBranch');
|
||||||
export const mockHeadRef = vi.fn().mockResolvedValue('mockHeadRef');
|
export const mockHeadRef = jest.fn().mockResolvedValue('mockHeadRef');
|
||||||
export const mockRef = vi.fn().mockResolvedValue('mockRef');
|
export const mockRef = jest.fn().mockResolvedValue('mockRef');
|
||||||
export const mockDetermineVersion = vi.fn().mockResolvedValue('1.2.3');
|
export const mockDetermineVersion = jest.fn().mockResolvedValue('1.2.3');
|
||||||
export const mockGenerateSemanticVersion = vi.fn().mockResolvedValue('2.3.4');
|
export const mockGenerateSemanticVersion = jest.fn().mockResolvedValue('2.3.4');
|
||||||
export const mockGenerateTagVersion = vi.fn().mockResolvedValue('1.0');
|
export const mockGenerateTagVersion = jest.fn().mockResolvedValue('1.0');
|
||||||
export const mockParseSemanticVersion = vi.fn().mockResolvedValue({});
|
export const mockParseSemanticVersion = jest.fn().mockResolvedValue({});
|
||||||
export const mockFetch = vi.fn().mockImplementation(() => {});
|
export const mockFetch = jest.fn().mockImplementation(() => {});
|
||||||
export const mockGetVersionDescription = vi.fn().mockResolvedValue('1.2-3-g12345678-dirty');
|
export const mockGetVersionDescription = jest.fn().mockResolvedValue('1.2-3-g12345678-dirty');
|
||||||
export const mockIsDirty = vi.fn().mockResolvedValue(false);
|
export const mockIsDirty = jest.fn().mockResolvedValue(false);
|
||||||
export const mockGetTag = vi.fn().mockResolvedValue('v1.0');
|
export const mockGetTag = jest.fn().mockResolvedValue('v1.0');
|
||||||
export const mockHasAnyVersionTags = vi.fn().mockResolvedValue(true);
|
export const mockHasAnyVersionTags = jest.fn().mockResolvedValue(true);
|
||||||
export const mockGetTotalNumberOfCommits = vi.fn().mockResolvedValue(3);
|
export const mockGetTotalNumberOfCommits = jest.fn().mockResolvedValue(3);
|
||||||
export const mockGit = vi.fn().mockImplementation(() => {});
|
export const mockGit = jest.fn().mockImplementation(() => {});
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
projectPath: mockProjectPath,
|
projectPath: mockProjectPath,
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`Versioning > determineBuildVersion > throws for invalid strategy somethingRandom 1`] = `[ValidationError: Versioning strategy should be one of None, Semantic, Tag, Custom.]`;
|
exports[`Versioning determineBuildVersion throws for invalid strategy somethingRandom 1`] = `"Versioning strategy should be one of None, Semantic, Tag, Custom."`;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import Action from './action';
|
import Action from './action';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import AndroidVersioning from './android-versioning';
|
import AndroidVersioning from './android-versioning';
|
||||||
|
|
||||||
describe('Android Versioning', () => {
|
describe('Android Versioning', () => {
|
||||||
@@ -36,9 +35,7 @@ describe('Android Versioning', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('uses the specified api level', () => {
|
it('uses the specified api level', () => {
|
||||||
expect(AndroidVersioning.determineSdkManagerParameters('AndroidApiLevel30')).toBe(
|
expect(AndroidVersioning.determineSdkManagerParameters('AndroidApiLevel30')).toBe('platforms;android-30');
|
||||||
'platforms;android-30',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ export default class AndroidVersioning {
|
|||||||
|
|
||||||
static versionToVersionCode(version: string): string {
|
static versionToVersionCode(version: string): string {
|
||||||
if (version === 'none') {
|
if (version === 'none') {
|
||||||
core.info(
|
core.info(`Versioning strategy is set to ${version}, so android version code should not be applied.`);
|
||||||
`Versioning strategy is set to ${version}, so android version code should not be applied.`,
|
|
||||||
);
|
|
||||||
|
|
||||||
return '0';
|
return '0';
|
||||||
}
|
}
|
||||||
@@ -29,8 +27,7 @@ export default class AndroidVersioning {
|
|||||||
|
|
||||||
// The greatest value Google Plays allows is 2100000000.
|
// The greatest value Google Plays allows is 2100000000.
|
||||||
// Allow for 3 patch digits, 3 minor digits and 3 major digits.
|
// Allow for 3 patch digits, 3 minor digits and 3 major digits.
|
||||||
const versionCode =
|
const versionCode = parsedVersion.major * 1000000 + parsedVersion.minor * 1000 + parsedVersion.patch;
|
||||||
parsedVersion.major * 1000000 + parsedVersion.minor * 1000 + parsedVersion.patch;
|
|
||||||
|
|
||||||
if (versionCode >= 2050000000) {
|
if (versionCode >= 2050000000) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, test, vi } from 'vitest';
|
|
||||||
import Versioning from './versioning';
|
import Versioning from './versioning';
|
||||||
import UnityVersioning from './unity-versioning';
|
import UnityVersioning from './unity-versioning';
|
||||||
import AndroidVersioning from './android-versioning';
|
import AndroidVersioning from './android-versioning';
|
||||||
@@ -10,12 +9,12 @@ const testLicense =
|
|||||||
'<?xml version="1.0" encoding="UTF-8"?><root>\n <License id="Terms">\n <MachineBindings>\n <Binding Key="1" Value="576562626572264761624c65526f7578"/>\n <Binding Key="2" Value="576562626572264761624c65526f7578"/>\n </MachineBindings>\n <MachineID Value="D7nTUnjNAmtsUMcnoyrqkgIbYdM="/>\n <SerialHash Value="2033b8ac3e6faa3742ca9f0bfae44d18f2a96b80"/>\n <Features>\n <Feature Value="33"/>\n <Feature Value="1"/>\n <Feature Value="12"/>\n <Feature Value="2"/>\n <Feature Value="24"/>\n <Feature Value="3"/>\n <Feature Value="36"/>\n <Feature Value="17"/>\n <Feature Value="19"/>\n <Feature Value="62"/>\n </Features>\n <DeveloperData Value="AQAAAEY0LUJHUlgtWEQ0RS1aQ1dWLUM1SlctR0RIQg=="/>\n <SerialMasked Value="F4-BGRX-XD4E-ZCWV-C5JW-XXXX"/>\n <StartDate Value="2021-02-08T00:00:00"/>\n <UpdateDate Value="2021-02-09T00:34:57"/>\n <InitialActivationDate Value="2021-02-08T00:34:56"/>\n <LicenseVersion Value="6.x"/>\n <ClientProvidedVersion Value="2018.4.30f1"/>\n <AlwaysOnline Value="false"/>\n <Entitlements>\n <Entitlement Ns="unity_editor" Tag="UnityPersonal" Type="EDITOR" ValidTo="9999-12-31T00:00:00"/>\n <Entitlement Ns="unity_editor" Tag="DarkSkin" Type="EDITOR_FEATURE" ValidTo="9999-12-31T00:00:00"/>\n </Entitlements>\n </License>\n<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><Reference URI="#Terms"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>m0Db8UK+ktnOLJBtHybkfetpcKo=</DigestValue></Reference></SignedInfo><SignatureValue>o/pUbSQAukz7+ZYAWhnA0AJbIlyyCPL7bKVEM2lVqbrXt7cyey+umkCXamuOgsWPVUKBMkXtMH8L\n5etLmD0getWIhTGhzOnDCk+gtIPfL4jMo9tkEuOCROQAXCci23VFscKcrkB+3X6h4wEOtA2APhOY\nB+wvC794o8/82ffjP79aVAi57rp3Wmzx+9pe9yMwoJuljAy2sc2tIMgdQGWVmOGBpQm3JqsidyzI\nJWG2kjnc7pDXK9pwYzXoKiqUqqrut90d+kQqRyv7MSZXR50HFqD/LI69h68b7P8Bjo3bPXOhNXGR\n9YCoemH6EkfCJxp2gIjzjWW+l2Hj2EsFQi8YXw==</SignatureValue></Signature></root>';
|
'<?xml version="1.0" encoding="UTF-8"?><root>\n <License id="Terms">\n <MachineBindings>\n <Binding Key="1" Value="576562626572264761624c65526f7578"/>\n <Binding Key="2" Value="576562626572264761624c65526f7578"/>\n </MachineBindings>\n <MachineID Value="D7nTUnjNAmtsUMcnoyrqkgIbYdM="/>\n <SerialHash Value="2033b8ac3e6faa3742ca9f0bfae44d18f2a96b80"/>\n <Features>\n <Feature Value="33"/>\n <Feature Value="1"/>\n <Feature Value="12"/>\n <Feature Value="2"/>\n <Feature Value="24"/>\n <Feature Value="3"/>\n <Feature Value="36"/>\n <Feature Value="17"/>\n <Feature Value="19"/>\n <Feature Value="62"/>\n </Features>\n <DeveloperData Value="AQAAAEY0LUJHUlgtWEQ0RS1aQ1dWLUM1SlctR0RIQg=="/>\n <SerialMasked Value="F4-BGRX-XD4E-ZCWV-C5JW-XXXX"/>\n <StartDate Value="2021-02-08T00:00:00"/>\n <UpdateDate Value="2021-02-09T00:34:57"/>\n <InitialActivationDate Value="2021-02-08T00:34:56"/>\n <LicenseVersion Value="6.x"/>\n <ClientProvidedVersion Value="2018.4.30f1"/>\n <AlwaysOnline Value="false"/>\n <Entitlements>\n <Entitlement Ns="unity_editor" Tag="UnityPersonal" Type="EDITOR" ValidTo="9999-12-31T00:00:00"/>\n <Entitlement Ns="unity_editor" Tag="DarkSkin" Type="EDITOR_FEATURE" ValidTo="9999-12-31T00:00:00"/>\n </Entitlements>\n </License>\n<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><Reference URI="#Terms"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>m0Db8UK+ktnOLJBtHybkfetpcKo=</DigestValue></Reference></SignedInfo><SignatureValue>o/pUbSQAukz7+ZYAWhnA0AJbIlyyCPL7bKVEM2lVqbrXt7cyey+umkCXamuOgsWPVUKBMkXtMH8L\n5etLmD0getWIhTGhzOnDCk+gtIPfL4jMo9tkEuOCROQAXCci23VFscKcrkB+3X6h4wEOtA2APhOY\nB+wvC794o8/82ffjP79aVAi57rp3Wmzx+9pe9yMwoJuljAy2sc2tIMgdQGWVmOGBpQm3JqsidyzI\nJWG2kjnc7pDXK9pwYzXoKiqUqqrut90d+kQqRyv7MSZXR50HFqD/LI69h68b7P8Bjo3bPXOhNXGR\n9YCoemH6EkfCJxp2gIjzjWW+l2Hj2EsFQi8YXw==</SignatureValue></Signature></root>';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
vi.restoreAllMocks();
|
jest.restoreAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.spyOn(Versioning, 'determineBuildVersion').mockImplementation(async () => '1.3.37');
|
jest.spyOn(Versioning, 'determineBuildVersion').mockImplementation(async () => '1.3.37');
|
||||||
process.env.UNITY_LICENSE = testLicense; // Todo - Don't use process.env directly, that's what the input model class is for.
|
process.env.UNITY_LICENSE = testLicense; // Todo - Don't use process.env directly, that's what the input model class is for.
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -26,20 +25,20 @@ describe('BuildParameters', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('determines the version only once', async () => {
|
it('determines the version only once', async () => {
|
||||||
vi.spyOn(Versioning, 'determineBuildVersion').mockImplementation(async () => '1.3.37');
|
jest.spyOn(Versioning, 'determineBuildVersion').mockImplementation(async () => '1.3.37');
|
||||||
await BuildParameters.create();
|
await BuildParameters.create();
|
||||||
await expect(Versioning.determineBuildVersion).toHaveBeenCalledTimes(1);
|
await expect(Versioning.determineBuildVersion).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('determines the unity version only once', async () => {
|
it('determines the unity version only once', async () => {
|
||||||
vi.spyOn(UnityVersioning, 'determineUnityVersion').mockImplementation(() => '2019.2.11f1');
|
jest.spyOn(UnityVersioning, 'determineUnityVersion').mockImplementation(() => '2019.2.11f1');
|
||||||
await BuildParameters.create();
|
await BuildParameters.create();
|
||||||
expect(UnityVersioning.determineUnityVersion).toHaveBeenCalledTimes(1);
|
expect(UnityVersioning.determineUnityVersion).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the android version code with provided input', async () => {
|
it('returns the android version code with provided input', async () => {
|
||||||
const mockValue = '42';
|
const mockValue = '42';
|
||||||
vi.spyOn(Input, 'androidVersionCode', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'androidVersionCode', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ androidVersionCode: mockValue }),
|
expect.objectContaining({ androidVersionCode: mockValue }),
|
||||||
);
|
);
|
||||||
@@ -47,59 +46,49 @@ describe('BuildParameters', () => {
|
|||||||
|
|
||||||
it('returns the android version code from version by default', async () => {
|
it('returns the android version code from version by default', async () => {
|
||||||
const mockValue = '';
|
const mockValue = '';
|
||||||
vi.spyOn(Input, 'androidVersionCode', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'androidVersionCode', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ androidVersionCode: '1003037' }),
|
expect.objectContaining({ androidVersionCode: '1003037' }),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('determines the android sdk manager parameters only once', async () => {
|
it('determines the android sdk manager parameters only once', async () => {
|
||||||
vi.spyOn(AndroidVersioning, 'determineSdkManagerParameters').mockImplementation(
|
jest.spyOn(AndroidVersioning, 'determineSdkManagerParameters').mockImplementation(() => 'platforms;android-30');
|
||||||
() => 'platforms;android-30',
|
|
||||||
);
|
|
||||||
await BuildParameters.create();
|
await BuildParameters.create();
|
||||||
expect(AndroidVersioning.determineSdkManagerParameters).toHaveBeenCalledTimes(1);
|
expect(AndroidVersioning.determineSdkManagerParameters).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the targetPlatform', async () => {
|
it('returns the targetPlatform', async () => {
|
||||||
const mockValue = 'somePlatform';
|
const mockValue = 'somePlatform';
|
||||||
vi.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ targetPlatform: mockValue }));
|
||||||
expect.objectContaining({ targetPlatform: mockValue }),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the project path', async () => {
|
it('returns the project path', async () => {
|
||||||
const mockValue = 'path/to/project';
|
const mockValue = 'path/to/project';
|
||||||
vi.spyOn(UnityVersioning, 'determineUnityVersion').mockImplementation(() => '2019.2.11f1');
|
jest.spyOn(UnityVersioning, 'determineUnityVersion').mockImplementation(() => '2019.2.11f1');
|
||||||
vi.spyOn(Input, 'projectPath', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'projectPath', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ projectPath: mockValue }));
|
||||||
expect.objectContaining({ projectPath: mockValue }),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the build profile', async () => {
|
it('returns the build profile', async () => {
|
||||||
const mockValue = 'path/to/build_profile.asset';
|
const mockValue = 'path/to/build_profile.asset';
|
||||||
vi.spyOn(Input, 'buildProfile', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'buildProfile', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ buildProfile: mockValue }));
|
||||||
expect.objectContaining({ buildProfile: mockValue }),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the build name', async () => {
|
it('returns the build name', async () => {
|
||||||
const mockValue = 'someBuildName';
|
const mockValue = 'someBuildName';
|
||||||
vi.spyOn(Input, 'buildName', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'buildName', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ buildName: mockValue }));
|
||||||
expect.objectContaining({ buildName: mockValue }),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the build path', async () => {
|
it('returns the build path', async () => {
|
||||||
const mockPath = 'somePath';
|
const mockPath = 'somePath';
|
||||||
const mockPlatform = 'somePlatform';
|
const mockPlatform = 'somePlatform';
|
||||||
const expectedBuildPath = `${mockPath}/${mockPlatform}`;
|
const expectedBuildPath = `${mockPath}/${mockPlatform}`;
|
||||||
vi.spyOn(Input, 'buildsPath', 'get').mockReturnValue(mockPath);
|
jest.spyOn(Input, 'buildsPath', 'get').mockReturnValue(mockPath);
|
||||||
vi.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(mockPlatform);
|
jest.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(mockPlatform);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ buildPath: expectedBuildPath }),
|
expect.objectContaining({ buildPath: expectedBuildPath }),
|
||||||
);
|
);
|
||||||
@@ -109,29 +98,24 @@ describe('BuildParameters', () => {
|
|||||||
const mockValue = 'someBuildName';
|
const mockValue = 'someBuildName';
|
||||||
const mockPlatform = 'somePlatform';
|
const mockPlatform = 'somePlatform';
|
||||||
|
|
||||||
vi.spyOn(Input, 'buildName', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'buildName', 'get').mockReturnValue(mockValue);
|
||||||
vi.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(mockPlatform);
|
jest.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(mockPlatform);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ buildFile: mockValue }));
|
||||||
expect.objectContaining({ buildFile: mockValue }),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each`
|
test.each`
|
||||||
targetPlatform | expectedExtension | androidExportType | linux64RemoveExecutableExtension
|
targetPlatform | expectedExtension | androidExportType
|
||||||
${Platform.types.Android} | ${'.apk'} | ${'androidPackage'} | ${false}
|
${Platform.types.Android} | ${'.apk'} | ${'androidPackage'}
|
||||||
${Platform.types.Android} | ${'.aab'} | ${'androidAppBundle'} | ${true}
|
${Platform.types.Android} | ${'.aab'} | ${'androidAppBundle'}
|
||||||
${Platform.types.Android} | ${''} | ${'androidStudioProject'} | ${false}
|
${Platform.types.Android} | ${''} | ${'androidStudioProject'}
|
||||||
${Platform.types.StandaloneWindows} | ${'.exe'} | ${'n/a'} | ${true}
|
${Platform.types.StandaloneWindows} | ${'.exe'} | ${'n/a'}
|
||||||
${Platform.types.StandaloneWindows64} | ${'.exe'} | ${'n/a'} | ${false}
|
${Platform.types.StandaloneWindows64} | ${'.exe'} | ${'n/a'}
|
||||||
${Platform.types.StandaloneLinux64} | ${'.x86_64'} | ${'n/a'} | ${false}
|
|
||||||
${Platform.types.StandaloneLinux64} | ${''} | ${'n/a'} | ${true}
|
|
||||||
`(
|
`(
|
||||||
'appends $expectedExtension for $targetPlatform with linux64RemoveExecutableExtension=$linux64RemoveExecutableExtension',
|
'appends $expectedExtension for $targetPlatform with androidExportType $androidExportType',
|
||||||
async ({ targetPlatform, expectedExtension, androidExportType, linux64RemoveExecutableExtension }) => {
|
async ({ targetPlatform, expectedExtension, androidExportType }) => {
|
||||||
vi.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(targetPlatform);
|
jest.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(targetPlatform);
|
||||||
vi.spyOn(Input, 'buildName', 'get').mockReturnValue(targetPlatform);
|
jest.spyOn(Input, 'buildName', 'get').mockReturnValue(targetPlatform);
|
||||||
vi.spyOn(Input, 'androidExportType', 'get').mockReturnValue(androidExportType);
|
jest.spyOn(Input, 'androidExportType', 'get').mockReturnValue(androidExportType);
|
||||||
vi.spyOn(Input, 'linux64RemoveExecutableExtension', 'get').mockReturnValue(linux64RemoveExecutableExtension);
|
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ buildFile: `${targetPlatform}${expectedExtension}` }),
|
expect.objectContaining({ buildFile: `${targetPlatform}${expectedExtension}` }),
|
||||||
);
|
);
|
||||||
@@ -148,26 +132,22 @@ describe('BuildParameters', () => {
|
|||||||
`(
|
`(
|
||||||
'androidSymbolType is set to $androidSymbolType when targetPlatform is $targetPlatform and input targetSymbolType is $androidSymbolType',
|
'androidSymbolType is set to $androidSymbolType when targetPlatform is $targetPlatform and input targetSymbolType is $androidSymbolType',
|
||||||
async ({ targetPlatform, androidSymbolType }) => {
|
async ({ targetPlatform, androidSymbolType }) => {
|
||||||
vi.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(targetPlatform);
|
jest.spyOn(Input, 'targetPlatform', 'get').mockReturnValue(targetPlatform);
|
||||||
vi.spyOn(Input, 'androidSymbolType', 'get').mockReturnValue(androidSymbolType);
|
jest.spyOn(Input, 'androidSymbolType', 'get').mockReturnValue(androidSymbolType);
|
||||||
vi.spyOn(Input, 'buildName', 'get').mockReturnValue(targetPlatform);
|
jest.spyOn(Input, 'buildName', 'get').mockReturnValue(targetPlatform);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ androidSymbolType }));
|
||||||
expect.objectContaining({ androidSymbolType }),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
it('returns the build method', async () => {
|
it('returns the build method', async () => {
|
||||||
const mockValue = 'Namespace.ClassName.BuildMethod';
|
const mockValue = 'Namespace.ClassName.BuildMethod';
|
||||||
vi.spyOn(Input, 'buildMethod', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'buildMethod', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ buildMethod: mockValue }));
|
||||||
expect.objectContaining({ buildMethod: mockValue }),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the android keystore name', async () => {
|
it('returns the android keystore name', async () => {
|
||||||
const mockValue = 'keystore.keystore';
|
const mockValue = 'keystore.keystore';
|
||||||
vi.spyOn(Input, 'androidKeystoreName', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'androidKeystoreName', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ androidKeystoreName: mockValue }),
|
expect.objectContaining({ androidKeystoreName: mockValue }),
|
||||||
);
|
);
|
||||||
@@ -175,7 +155,7 @@ describe('BuildParameters', () => {
|
|||||||
|
|
||||||
it('returns the android keystore base64-encoded content', async () => {
|
it('returns the android keystore base64-encoded content', async () => {
|
||||||
const mockValue = 'secret';
|
const mockValue = 'secret';
|
||||||
vi.spyOn(Input, 'androidKeystoreBase64', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'androidKeystoreBase64', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ androidKeystoreBase64: mockValue }),
|
expect.objectContaining({ androidKeystoreBase64: mockValue }),
|
||||||
);
|
);
|
||||||
@@ -183,7 +163,7 @@ describe('BuildParameters', () => {
|
|||||||
|
|
||||||
it('returns the android keystore pass', async () => {
|
it('returns the android keystore pass', async () => {
|
||||||
const mockValue = 'secret';
|
const mockValue = 'secret';
|
||||||
vi.spyOn(Input, 'androidKeystorePass', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'androidKeystorePass', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ androidKeystorePass: mockValue }),
|
expect.objectContaining({ androidKeystorePass: mockValue }),
|
||||||
);
|
);
|
||||||
@@ -191,7 +171,7 @@ describe('BuildParameters', () => {
|
|||||||
|
|
||||||
it('returns the android keyalias name', async () => {
|
it('returns the android keyalias name', async () => {
|
||||||
const mockValue = 'secret';
|
const mockValue = 'secret';
|
||||||
vi.spyOn(Input, 'androidKeyaliasName', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'androidKeyaliasName', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ androidKeyaliasName: mockValue }),
|
expect.objectContaining({ androidKeyaliasName: mockValue }),
|
||||||
);
|
);
|
||||||
@@ -199,7 +179,7 @@ describe('BuildParameters', () => {
|
|||||||
|
|
||||||
it('returns the android keyalias pass', async () => {
|
it('returns the android keyalias pass', async () => {
|
||||||
const mockValue = 'secret';
|
const mockValue = 'secret';
|
||||||
vi.spyOn(Input, 'androidKeyaliasPass', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'androidKeyaliasPass', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ androidKeyaliasPass: mockValue }),
|
expect.objectContaining({ androidKeyaliasPass: mockValue }),
|
||||||
);
|
);
|
||||||
@@ -207,7 +187,7 @@ describe('BuildParameters', () => {
|
|||||||
|
|
||||||
it('returns the android target sdk version', async () => {
|
it('returns the android target sdk version', async () => {
|
||||||
const mockValue = 'AndroidApiLevelAuto';
|
const mockValue = 'AndroidApiLevelAuto';
|
||||||
vi.spyOn(Input, 'androidTargetSdkVersion', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'androidTargetSdkVersion', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ androidTargetSdkVersion: mockValue }),
|
expect.objectContaining({ androidTargetSdkVersion: mockValue }),
|
||||||
);
|
);
|
||||||
@@ -215,7 +195,7 @@ describe('BuildParameters', () => {
|
|||||||
|
|
||||||
it('returns the unity licensing server address', async () => {
|
it('returns the unity licensing server address', async () => {
|
||||||
const mockValue = 'http://example.com';
|
const mockValue = 'http://example.com';
|
||||||
vi.spyOn(Input, 'unityLicensingServer', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'unityLicensingServer', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(
|
||||||
expect.objectContaining({ unityLicensingServer: mockValue }),
|
expect.objectContaining({ unityLicensingServer: mockValue }),
|
||||||
);
|
);
|
||||||
@@ -230,25 +210,19 @@ describe('BuildParameters', () => {
|
|||||||
const mockValue = '123';
|
const mockValue = '123';
|
||||||
delete process.env.UNITY_LICENSE; // Need to delete this as it is set for every test currently
|
delete process.env.UNITY_LICENSE; // Need to delete this as it is set for every test currently
|
||||||
process.env.UNITY_SERIAL = mockValue;
|
process.env.UNITY_SERIAL = mockValue;
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ unitySerial: mockValue }));
|
||||||
expect.objectContaining({ unitySerial: mockValue }),
|
|
||||||
);
|
|
||||||
delete process.env.UNITY_SERIAL;
|
delete process.env.UNITY_SERIAL;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the custom parameters', async () => {
|
it('returns the custom parameters', async () => {
|
||||||
const mockValue = '-profile SomeProfile -someBoolean -someValue exampleValue';
|
const mockValue = '-profile SomeProfile -someBoolean -someValue exampleValue';
|
||||||
vi.spyOn(Input, 'customParameters', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'customParameters', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ customParameters: mockValue }));
|
||||||
expect.objectContaining({ customParameters: mockValue }),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each([true, false])('returns the flag for useHostNetwork when %s', async (mockValue) => {
|
it.each([true, false])('returns the flag for useHostNetwork when %s', async (mockValue) => {
|
||||||
vi.spyOn(Input, 'useHostNetwork', 'get').mockReturnValue(mockValue);
|
jest.spyOn(Input, 'useHostNetwork', 'get').mockReturnValue(mockValue);
|
||||||
await expect(BuildParameters.create()).resolves.toEqual(
|
await expect(BuildParameters.create()).resolves.toEqual(expect.objectContaining({ useHostNetwork: mockValue }));
|
||||||
expect.objectContaining({ useHostNetwork: mockValue }),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -69,27 +69,11 @@ class BuildParameters {
|
|||||||
public dockerWorkspacePath!: string;
|
public dockerWorkspacePath!: string;
|
||||||
|
|
||||||
static async create(): Promise<BuildParameters> {
|
static async create(): Promise<BuildParameters> {
|
||||||
const buildFile = this.parseBuildFile(
|
const buildFile = this.parseBuildFile(Input.buildName, Input.targetPlatform, Input.androidExportType);
|
||||||
Input.buildName,
|
const editorVersion = UnityVersioning.determineUnityVersion(Input.projectPath, Input.unityVersion);
|
||||||
Input.targetPlatform,
|
const buildVersion = await Versioning.determineBuildVersion(Input.versioningStrategy, Input.specifiedVersion);
|
||||||
Input.androidExportType,
|
const androidVersionCode = AndroidVersioning.determineVersionCode(buildVersion, Input.androidVersionCode);
|
||||||
Input.linux64RemoveExecutableExtension,
|
const androidSdkManagerParameters = AndroidVersioning.determineSdkManagerParameters(Input.androidTargetSdkVersion);
|
||||||
);
|
|
||||||
const editorVersion = UnityVersioning.determineUnityVersion(
|
|
||||||
Input.projectPath,
|
|
||||||
Input.unityVersion,
|
|
||||||
);
|
|
||||||
const buildVersion = await Versioning.determineBuildVersion(
|
|
||||||
Input.versioningStrategy,
|
|
||||||
Input.specifiedVersion,
|
|
||||||
);
|
|
||||||
const androidVersionCode = AndroidVersioning.determineVersionCode(
|
|
||||||
buildVersion,
|
|
||||||
Input.androidVersionCode,
|
|
||||||
);
|
|
||||||
const androidSdkManagerParameters = AndroidVersioning.determineSdkManagerParameters(
|
|
||||||
Input.androidTargetSdkVersion,
|
|
||||||
);
|
|
||||||
|
|
||||||
const androidSymbolExportType = Input.androidSymbolType;
|
const androidSymbolExportType = Input.androidSymbolType;
|
||||||
if (Platform.isAndroid(Input.targetPlatform)) {
|
if (Platform.isAndroid(Input.targetPlatform)) {
|
||||||
@@ -128,8 +112,7 @@ class BuildParameters {
|
|||||||
core.setSecret(`${unitySerial.slice(0, -4)}XXXX`);
|
core.setSecret(`${unitySerial.slice(0, -4)}XXXX`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const providerStrategy =
|
const providerStrategy = Input.getInput('providerStrategy') || (Cli.isCliMode ? 'aws' : 'local');
|
||||||
Input.getInput('providerStrategy') || (Cli.isCliMode ? 'aws' : 'local');
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
editorVersion,
|
editorVersion,
|
||||||
@@ -174,8 +157,7 @@ class BuildParameters {
|
|||||||
buildPlatform: providerStrategy !== 'local' ? 'linux' : process.platform,
|
buildPlatform: providerStrategy !== 'local' ? 'linux' : process.platform,
|
||||||
runNumber: Input.runNumber,
|
runNumber: Input.runNumber,
|
||||||
branch: Input.branch.replace('/head', '') || (await GitRepoReader.GetBranch()),
|
branch: Input.branch.replace('/head', '') || (await GitRepoReader.GetBranch()),
|
||||||
githubRepo:
|
githubRepo: (Input.githubRepo ?? (await GitRepoReader.GetRemote())) || 'game-ci/unity-builder',
|
||||||
(Input.githubRepo ?? (await GitRepoReader.GetRemote())) || 'game-ci/unity-builder',
|
|
||||||
gitSha: Input.gitSha,
|
gitSha: Input.gitSha,
|
||||||
logId: customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 9)(),
|
logId: customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 9)(),
|
||||||
buildGuid: `${Input.runNumber}-${Input.targetPlatform.toLowerCase().replace('standalone', '')}-${customAlphabet(
|
buildGuid: `${Input.runNumber}-${Input.targetPlatform.toLowerCase().replace('standalone', '')}-${customAlphabet(
|
||||||
@@ -189,12 +171,7 @@ class BuildParameters {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static parseBuildFile(
|
static parseBuildFile(filename: string, platform: string, androidExportType: string): string {
|
||||||
filename: string,
|
|
||||||
platform: string,
|
|
||||||
androidExportType: string,
|
|
||||||
linux64RemoveExecutableExtension: boolean,
|
|
||||||
): string {
|
|
||||||
if (Platform.isWindows(platform)) {
|
if (Platform.isWindows(platform)) {
|
||||||
return `${filename}.exe`;
|
return `${filename}.exe`;
|
||||||
}
|
}
|
||||||
@@ -214,10 +191,6 @@ class BuildParameters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platform === Platform.types.StandaloneLinux64 && !linux64RemoveExecutableExtension) {
|
|
||||||
return `${filename}.x86_64`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { describe, it, expect, beforeEach, afterEach, beforeAll, afterAll, vi } from 'vitest';
|
|
||||||
import Cache from './cache';
|
import Cache from './cache';
|
||||||
|
|
||||||
vi.mock('./input');
|
jest.mock('./input');
|
||||||
|
|
||||||
describe('Cache', () => {
|
describe('Cache', () => {
|
||||||
describe('Verification', () => {
|
describe('Verification', () => {
|
||||||
|
|||||||
@@ -39,10 +39,7 @@ export class Cli {
|
|||||||
.map((x) => `${x.key} (${x.description})`)
|
.map((x) => `${x.key} (${x.description})`)
|
||||||
.join(` | `),
|
.join(` | `),
|
||||||
);
|
);
|
||||||
program.option(
|
program.option('--populateOverride <populateOverride>', 'should use override query to pull input false by default');
|
||||||
'--populateOverride <populateOverride>',
|
|
||||||
'should use override query to pull input false by default',
|
|
||||||
);
|
|
||||||
program.option('--cachePushFrom <cachePushFrom>', 'cache push from source folder');
|
program.option('--cachePushFrom <cachePushFrom>', 'cache push from source folder');
|
||||||
program.option('--cachePushTo <cachePushTo>', 'cache push to caching folder');
|
program.option('--cachePushTo <cachePushTo>', 'cache push to caching folder');
|
||||||
program.option('--artifactName <artifactName>', 'caching artifact name');
|
program.option('--artifactName <artifactName>', 'caching artifact name');
|
||||||
@@ -52,10 +49,7 @@ export class Cli {
|
|||||||
program.option('--variantPath <variantPath>', 'path to submodule variant YAML');
|
program.option('--variantPath <variantPath>', 'path to submodule variant YAML');
|
||||||
program.option('--agentPath <agentPath>', 'path to custom LFS transfer agent');
|
program.option('--agentPath <agentPath>', 'path to custom LFS transfer agent');
|
||||||
program.option('--agentArgs <agentArgs>', 'arguments for custom LFS transfer agent');
|
program.option('--agentArgs <agentArgs>', 'arguments for custom LFS transfer agent');
|
||||||
program.option(
|
program.option('--storagePaths <storagePaths>', 'semicolon-separated storage paths for LFS agent');
|
||||||
'--storagePaths <storagePaths>',
|
|
||||||
'semicolon-separated storage paths for LFS agent',
|
|
||||||
);
|
|
||||||
program.parse(process.argv);
|
program.parse(process.argv);
|
||||||
Cli.options = program.opts();
|
Cli.options = program.opts();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import Action from './action';
|
import Action from './action';
|
||||||
import Docker from './docker';
|
import Docker from './docker';
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,7 @@ class Docker {
|
|||||||
let runCommand = '';
|
let runCommand = '';
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'linux':
|
case 'linux':
|
||||||
runCommand = this.getLinuxCommand(
|
runCommand = this.getLinuxCommand(image, parameters, overrideCommands, additionalVariables, entrypointBash);
|
||||||
image,
|
|
||||||
parameters,
|
|
||||||
overrideCommands,
|
|
||||||
additionalVariables,
|
|
||||||
entrypointBash,
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
case 'win32':
|
case 'win32':
|
||||||
runCommand = this.getWindowsCommand(image, parameters);
|
runCommand = this.getWindowsCommand(image, parameters);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import CommandExecutionError from './command-execution-error';
|
import CommandExecutionError from './command-execution-error';
|
||||||
|
|
||||||
describe('CommandExecutionError', () => {
|
describe('CommandExecutionError', () => {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import NotImplementedException from './not-implemented-exception';
|
import NotImplementedException from './not-implemented-exception';
|
||||||
|
|
||||||
describe('NotImplementedException', () => {
|
describe('NotImplementedException', () => {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import ValidationError from './validation-error';
|
import ValidationError from './validation-error';
|
||||||
|
|
||||||
describe('ValidationError', () => {
|
describe('ValidationError', () => {
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
import { DockerParameters, StringKeyValuePair } from './shared-types';
|
import { DockerParameters, StringKeyValuePair } from './shared-types';
|
||||||
|
|
||||||
class ImageEnvironmentFactory {
|
class ImageEnvironmentFactory {
|
||||||
public static getEnvVarString(
|
public static getEnvVarString(parameters: DockerParameters, additionalVariables: StringKeyValuePair[] = []) {
|
||||||
parameters: DockerParameters,
|
const environmentVariables = ImageEnvironmentFactory.getEnvironmentVariables(parameters, additionalVariables);
|
||||||
additionalVariables: StringKeyValuePair[] = [],
|
|
||||||
) {
|
|
||||||
const environmentVariables = ImageEnvironmentFactory.getEnvironmentVariables(
|
|
||||||
parameters,
|
|
||||||
additionalVariables,
|
|
||||||
);
|
|
||||||
let string = '';
|
let string = '';
|
||||||
for (const p of environmentVariables) {
|
for (const p of environmentVariables) {
|
||||||
if (p.value === '' || p.value === undefined || p.value === null) {
|
if (p.value === '' || p.value === undefined || p.value === null) {
|
||||||
@@ -27,10 +21,7 @@ class ImageEnvironmentFactory {
|
|||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getEnvironmentVariables(
|
public static getEnvironmentVariables(parameters: DockerParameters, additionalVariables: StringKeyValuePair[] = []) {
|
||||||
parameters: DockerParameters,
|
|
||||||
additionalVariables: StringKeyValuePair[] = [],
|
|
||||||
) {
|
|
||||||
let environmentVariables: StringKeyValuePair[] = [
|
let environmentVariables: StringKeyValuePair[] = [
|
||||||
{ name: 'UNITY_EMAIL', value: process.env.UNITY_EMAIL },
|
{ name: 'UNITY_EMAIL', value: process.env.UNITY_EMAIL },
|
||||||
{ name: 'UNITY_PASSWORD', value: process.env.UNITY_PASSWORD },
|
{ name: 'UNITY_PASSWORD', value: process.env.UNITY_PASSWORD },
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import ImageTag from './image-tag';
|
import ImageTag from './image-tag';
|
||||||
|
|
||||||
describe('ImageTag', () => {
|
describe('ImageTag', () => {
|
||||||
@@ -28,18 +27,15 @@ describe('ImageTag', () => {
|
|||||||
expect(image.builderPlatform).toStrictEqual(testImageParameters.builderPlatform);
|
expect(image.builderPlatform).toStrictEqual(testImageParameters.builderPlatform);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each(['2000.0.0f0', '2011.1.11f1', '6000.0.0f1'])(
|
test.each(['2000.0.0f0', '2011.1.11f1', '6000.0.0f1'])('accepts %p version format', (version) => {
|
||||||
'accepts %p version format',
|
expect(
|
||||||
(version) => {
|
() =>
|
||||||
expect(
|
new ImageTag({
|
||||||
() =>
|
editorVersion: version,
|
||||||
new ImageTag({
|
targetPlatform: testImageParameters.targetPlatform,
|
||||||
editorVersion: version,
|
}),
|
||||||
targetPlatform: testImageParameters.targetPlatform,
|
).not.toThrow();
|
||||||
}),
|
});
|
||||||
).not.toThrow();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
test.each(['some version', ''])('throws for incorrect version %p', (editorVersion) => {
|
test.each(['some version', ''])('throws for incorrect version %p', (editorVersion) => {
|
||||||
const { targetPlatform } = testImageParameters;
|
const { targetPlatform } = testImageParameters;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import * as Index from '.';
|
import * as Index from '.';
|
||||||
|
|
||||||
interface ExportedModules {
|
interface ExportedModules {
|
||||||
|
|||||||
@@ -10,16 +10,4 @@ import Project from './project';
|
|||||||
import Unity from './unity';
|
import Unity from './unity';
|
||||||
import Versioning from './versioning';
|
import Versioning from './versioning';
|
||||||
|
|
||||||
export {
|
export { Action, BuildParameters, Cache, Docker, Input, ImageTag, Output, Platform, Project, Unity, Versioning };
|
||||||
Action,
|
|
||||||
BuildParameters,
|
|
||||||
Cache,
|
|
||||||
Docker,
|
|
||||||
Input,
|
|
||||||
ImageTag,
|
|
||||||
Output,
|
|
||||||
Platform,
|
|
||||||
Project,
|
|
||||||
Unity,
|
|
||||||
Versioning,
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, beforeEach, afterEach, beforeAll, afterAll, vi } from 'vitest';
|
|
||||||
import { GitRepoReader } from './git-repo';
|
import { GitRepoReader } from './git-repo';
|
||||||
import Input from '../input';
|
import Input from '../input';
|
||||||
|
|
||||||
@@ -10,15 +9,15 @@ describe(`git repo tests`, () => {
|
|||||||
|
|
||||||
it(`returns valid branch name when using https`, async () => {
|
it(`returns valid branch name when using https`, async () => {
|
||||||
const mockValue = 'https://github.com/example/example.git';
|
const mockValue = 'https://github.com/example/example.git';
|
||||||
vi.spyOn(GitRepoReader as any, 'runCommand').mockResolvedValue(mockValue);
|
jest.spyOn(GitRepoReader as any, 'runCommand').mockResolvedValue(mockValue);
|
||||||
vi.spyOn(Input, 'getInput').mockReturnValue('not-local');
|
jest.spyOn(Input, 'getInput').mockReturnValue('not-local');
|
||||||
expect(await GitRepoReader.GetRemote()).toEqual(`example/example`);
|
expect(await GitRepoReader.GetRemote()).toEqual(`example/example`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`returns valid branch name when using ssh`, async () => {
|
it(`returns valid branch name when using ssh`, async () => {
|
||||||
const mockValue = 'git@github.com:example/example.git';
|
const mockValue = 'git@github.com:example/example.git';
|
||||||
vi.spyOn(GitRepoReader as any, 'runCommand').mockResolvedValue(mockValue);
|
jest.spyOn(GitRepoReader as any, 'runCommand').mockResolvedValue(mockValue);
|
||||||
vi.spyOn(Input, 'getInput').mockReturnValue('not-local');
|
jest.spyOn(Input, 'getInput').mockReturnValue('not-local');
|
||||||
expect(await GitRepoReader.GetRemote()).toEqual(`example/example`);
|
expect(await GitRepoReader.GetRemote()).toEqual(`example/example`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,9 +23,7 @@ export class GitRepoReader {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
assert(fs.existsSync(`.git`));
|
assert(fs.existsSync(`.git`));
|
||||||
const value = (
|
const value = (await GitRepoReader.runCommand(`cd ${Input.projectPath} && git remote -v`)).replace(/ /g, ``);
|
||||||
await GitRepoReader.runCommand(`cd ${Input.projectPath} && git remote -v`)
|
|
||||||
).replace(/ /g, ``);
|
|
||||||
core.info(`value ${value}`);
|
core.info(`value ${value}`);
|
||||||
assert(value.includes('github.com'));
|
assert(value.includes('github.com'));
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import { GithubCliReader } from './github-cli';
|
import { GithubCliReader } from './github-cli';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,7 @@ export function ReadLicense(): string {
|
|||||||
if ((Input.getInput('providerStrategy') || 'local') === 'local') {
|
if ((Input.getInput('providerStrategy') || 'local') === 'local') {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
const pipelineFile = path.join(
|
const pipelineFile = path.join(__dirname, `.github`, `workflows`, `orchestrator-k8s-pipeline.yml`);
|
||||||
__dirname,
|
|
||||||
`.github`,
|
|
||||||
`workflows`,
|
|
||||||
`orchestrator-k8s-pipeline.yml`,
|
|
||||||
);
|
|
||||||
|
|
||||||
return fs.existsSync(pipelineFile)
|
return fs.existsSync(pipelineFile) ? YAML.parse(fs.readFileSync(pipelineFile, 'utf8')).env.UNITY_LICENSE : '';
|
||||||
? YAML.parse(fs.readFileSync(pipelineFile, 'utf8')).env.UNITY_LICENSE
|
|
||||||
: '';
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, test, vi } from 'vitest';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
import Input from './input';
|
import Input from './input';
|
||||||
import Platform from './platform';
|
import Platform from './platform';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.restoreAllMocks();
|
jest.restoreAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Input', () => {
|
describe('Input', () => {
|
||||||
@@ -16,7 +15,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = '2020.4.99f9';
|
const mockValue = '2020.4.99f9';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.unityVersion).toStrictEqual(mockValue);
|
expect(Input.unityVersion).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -28,7 +27,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = '2020.4.99f9';
|
const mockValue = '2020.4.99f9';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.customImage).toStrictEqual(mockValue);
|
expect(Input.customImage).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -41,7 +40,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'Android';
|
const mockValue = 'Android';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.targetPlatform).toStrictEqual(mockValue);
|
expect(Input.targetPlatform).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -54,7 +53,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'customProjectPath';
|
const mockValue = 'customProjectPath';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.projectPath).toStrictEqual(mockValue);
|
expect(Input.projectPath).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -67,7 +66,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'path/to/build_profile.asset';
|
const mockValue = 'path/to/build_profile.asset';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.buildProfile).toStrictEqual(mockValue);
|
expect(Input.buildProfile).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -80,14 +79,14 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'Build';
|
const mockValue = 'Build';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.buildName).toStrictEqual(mockValue);
|
expect(Input.buildName).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('takes special characters as input', () => {
|
it('takes special characters as input', () => {
|
||||||
const mockValue = '1ßúëld2';
|
const mockValue = '1ßúëld2';
|
||||||
vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.buildName).toStrictEqual(mockValue);
|
expect(Input.buildName).toStrictEqual(mockValue);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -99,7 +98,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'customBuildsPath';
|
const mockValue = 'customBuildsPath';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.buildsPath).toStrictEqual(mockValue);
|
expect(Input.buildsPath).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -112,7 +111,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'Namespace.ClassName.Method';
|
const mockValue = 'Namespace.ClassName.Method';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.buildMethod).toStrictEqual(mockValue);
|
expect(Input.buildMethod).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -124,13 +123,13 @@ describe('Input', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns true when string true is passed', () => {
|
it('returns true when string true is passed', () => {
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('true');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||||
expect(Input.manualExit).toStrictEqual(true);
|
expect(Input.manualExit).toStrictEqual(true);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when string false is passed', () => {
|
it('returns false when string false is passed', () => {
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('false');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
||||||
expect(Input.manualExit).toStrictEqual(false);
|
expect(Input.manualExit).toStrictEqual(false);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -142,13 +141,13 @@ describe('Input', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns true when string true is passed', () => {
|
it('returns true when string true is passed', () => {
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('true');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||||
expect(Input.enableGpu).toStrictEqual(true);
|
expect(Input.enableGpu).toStrictEqual(true);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when string false is passed', () => {
|
it('returns false when string false is passed', () => {
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('false');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
||||||
expect(Input.enableGpu).toStrictEqual(false);
|
expect(Input.enableGpu).toStrictEqual(false);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -161,7 +160,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'Anything';
|
const mockValue = 'Anything';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.versioningStrategy).toStrictEqual(mockValue);
|
expect(Input.versioningStrategy).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -174,7 +173,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = '1.33.7';
|
const mockValue = '1.33.7';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.specifiedVersion).toStrictEqual(mockValue);
|
expect(Input.specifiedVersion).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -187,7 +186,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = '42';
|
const mockValue = '42';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.androidVersionCode).toStrictEqual(mockValue);
|
expect(Input.androidVersionCode).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -204,7 +203,7 @@ describe('Input', () => {
|
|||||||
${'androidAppBundle'} | ${'androidAppBundle'}
|
${'androidAppBundle'} | ${'androidAppBundle'}
|
||||||
${'androidStudioProject'} | ${'androidStudioProject'}
|
${'androidStudioProject'} | ${'androidStudioProject'}
|
||||||
`('returns $expected when $input is passed', ({ input, expected }) => {
|
`('returns $expected when $input is passed', ({ input, expected }) => {
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(input);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(input);
|
||||||
expect(Input.androidExportType).toStrictEqual(expected);
|
expect(Input.androidExportType).toStrictEqual(expected);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -221,7 +220,7 @@ describe('Input', () => {
|
|||||||
${'public'} | ${'public'}
|
${'public'} | ${'public'}
|
||||||
${'debugging'} | ${'debugging'}
|
${'debugging'} | ${'debugging'}
|
||||||
`('returns $expected when $input is passed', ({ input, expected }) => {
|
`('returns $expected when $input is passed', ({ input, expected }) => {
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(input);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(input);
|
||||||
expect(Input.androidExportType).toStrictEqual(expected);
|
expect(Input.androidExportType).toStrictEqual(expected);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -234,7 +233,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'keystore.keystore';
|
const mockValue = 'keystore.keystore';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.androidKeystoreName).toStrictEqual(mockValue);
|
expect(Input.androidKeystoreName).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -247,7 +246,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'secret';
|
const mockValue = 'secret';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.androidKeystoreBase64).toStrictEqual(mockValue);
|
expect(Input.androidKeystoreBase64).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -260,7 +259,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'secret';
|
const mockValue = 'secret';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.androidKeystorePass).toStrictEqual(mockValue);
|
expect(Input.androidKeystorePass).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -273,7 +272,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'secret';
|
const mockValue = 'secret';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.androidKeyaliasName).toStrictEqual(mockValue);
|
expect(Input.androidKeyaliasName).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -286,7 +285,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'secret';
|
const mockValue = 'secret';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.androidKeyaliasPass).toStrictEqual(mockValue);
|
expect(Input.androidKeyaliasPass).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -299,7 +298,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = 'secret';
|
const mockValue = 'secret';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.androidTargetSdkVersion).toStrictEqual(mockValue);
|
expect(Input.androidTargetSdkVersion).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -311,13 +310,13 @@ describe('Input', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns true when string true is passed', () => {
|
it('returns true when string true is passed', () => {
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('true');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||||
expect(Input.allowDirtyBuild).toStrictEqual(true);
|
expect(Input.allowDirtyBuild).toStrictEqual(true);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when string false is passed', () => {
|
it('returns false when string false is passed', () => {
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('false');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
||||||
expect(Input.allowDirtyBuild).toStrictEqual(false);
|
expect(Input.allowDirtyBuild).toStrictEqual(false);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -330,7 +329,7 @@ describe('Input', () => {
|
|||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
const mockValue = '-imAFlag';
|
const mockValue = '-imAFlag';
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||||
expect(Input.customParameters).toStrictEqual(mockValue);
|
expect(Input.customParameters).toStrictEqual(mockValue);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -342,33 +341,15 @@ describe('Input', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns true when string true is passed', () => {
|
it('returns true when string true is passed', () => {
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('true');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||||
expect(Input.useHostNetwork).toStrictEqual(true);
|
expect(Input.useHostNetwork).toStrictEqual(true);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when string false is passed', () => {
|
it('returns false when string false is passed', () => {
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('false');
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
||||||
expect(Input.useHostNetwork).toStrictEqual(false);
|
expect(Input.useHostNetwork).toStrictEqual(false);
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('linux64RemoveExecutableExtension', () => {
|
|
||||||
it('returns the default value', () => {
|
|
||||||
expect(Input.linux64RemoveExecutableExtension).toStrictEqual(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns true when string true is passed', () => {
|
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('true');
|
|
||||||
expect(Input.linux64RemoveExecutableExtension).toStrictEqual(true);
|
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns false when string false is passed', () => {
|
|
||||||
const spy = vi.spyOn(core, 'getInput').mockReturnValue('false');
|
|
||||||
expect(Input.linux64RemoveExecutableExtension).toStrictEqual(false);
|
|
||||||
expect(spy).toHaveBeenCalledTimes(1);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,10 +47,7 @@ class Input {
|
|||||||
|
|
||||||
static get branch(): string {
|
static get branch(): string {
|
||||||
if (Input.getInput(`GITHUB_REF`)) {
|
if (Input.getInput(`GITHUB_REF`)) {
|
||||||
return Input.getInput(`GITHUB_REF`)!
|
return Input.getInput(`GITHUB_REF`)!.replace('refs/', '').replace(`head/`, '').replace(`heads/`, '');
|
||||||
.replace('refs/', '')
|
|
||||||
.replace(`head/`, '')
|
|
||||||
.replace(`heads/`, '');
|
|
||||||
} else if (Input.getInput('branch')) {
|
} else if (Input.getInput('branch')) {
|
||||||
return Input.getInput('branch')!;
|
return Input.getInput('branch')!;
|
||||||
} else {
|
} else {
|
||||||
@@ -263,8 +260,7 @@ class Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
Input.getInput('dockerMemoryLimit') ??
|
Input.getInput('dockerMemoryLimit') ?? `${Math.floor((os.totalmem() / bytesInMegabyte) * memoryMultiplier)}m`
|
||||||
`${Math.floor((os.totalmem() / bytesInMegabyte) * memoryMultiplier)}m`
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,12 +280,6 @@ class Input {
|
|||||||
return Input.getInput('skipActivation')?.toLowerCase() ?? 'false';
|
return Input.getInput('skipActivation')?.toLowerCase() ?? 'false';
|
||||||
}
|
}
|
||||||
|
|
||||||
static get linux64RemoveExecutableExtension(): boolean {
|
|
||||||
const input = Input.getInput('linux64RemoveExecutableExtension') ?? 'false';
|
|
||||||
|
|
||||||
return input === 'true';
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ToEnvVarFormat(input: string) {
|
public static ToEnvVarFormat(input: string) {
|
||||||
if (input.toUpperCase() === input) {
|
if (input.toUpperCase() === input) {
|
||||||
return input;
|
return input;
|
||||||
|
|||||||
@@ -1,17 +1,129 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compatibility tests for the legacy orchestrator-plugin module name.
|
* Tests for the orchestrator plugin loader (orchestrator-plugin.ts).
|
||||||
*
|
*
|
||||||
* CI targets this file pattern directly, and consumers may still import this
|
* The plugin loader dynamically imports @game-ci/orchestrator and calls
|
||||||
* module while migrating to the generic plugin API.
|
* createPlugin(). Two scenarios:
|
||||||
|
*
|
||||||
|
* 1. Package NOT installed — loadOrchestratorPlugin() returns undefined.
|
||||||
|
* 2. Package IS installed — returns the plugin from createPlugin().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
describe('orchestrator-plugin compatibility exports', () => {
|
const mockWarning = jest.fn();
|
||||||
it('keeps loadOrchestratorPlugin as an alias for loadPlugin', async () => {
|
const mockInfo = jest.fn();
|
||||||
const plugin = await import('./plugin');
|
jest.mock('@actions/core', () => ({
|
||||||
const compatibility = await import('./orchestrator-plugin');
|
warning: mockWarning,
|
||||||
|
info: mockInfo,
|
||||||
|
}));
|
||||||
|
|
||||||
expect(compatibility.loadOrchestratorPlugin).toBe(plugin.loadPlugin);
|
beforeEach(() => {
|
||||||
|
jest.resetModules();
|
||||||
|
mockWarning.mockClear();
|
||||||
|
mockInfo.mockClear();
|
||||||
|
});
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Part 1: Package NOT installed
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
describe('orchestrator-plugin (package not installed)', () => {
|
||||||
|
it('loadOrchestratorPlugin() returns undefined', async () => {
|
||||||
|
const { loadOrchestratorPlugin } = await import('./orchestrator-plugin');
|
||||||
|
|
||||||
|
const result = await loadOrchestratorPlugin();
|
||||||
|
|
||||||
|
expect(result).toBeUndefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Part 2: Package IS installed (mocked)
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
describe('orchestrator-plugin (package installed)', () => {
|
||||||
|
const fakePlugin = {
|
||||||
|
initialize: jest.fn(),
|
||||||
|
canHandleBuild: jest.fn().mockReturnValue(false),
|
||||||
|
handleBuild: jest.fn().mockResolvedValue({ exitCode: 0 }),
|
||||||
|
beforeLocalBuild: jest.fn(),
|
||||||
|
afterLocalBuild: jest.fn(),
|
||||||
|
handlePostBuild: jest.fn(),
|
||||||
|
};
|
||||||
|
|
||||||
|
const mockCreatePlugin = jest.fn().mockReturnValue(fakePlugin);
|
||||||
|
|
||||||
|
function installOrchestratorMock(overrides: Record<string, unknown> = {}) {
|
||||||
|
jest.doMock(
|
||||||
|
'@game-ci/orchestrator',
|
||||||
|
() => ({
|
||||||
|
createPlugin: mockCreatePlugin,
|
||||||
|
...overrides,
|
||||||
|
}),
|
||||||
|
{ virtual: true },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
mockCreatePlugin.mockClear();
|
||||||
|
fakePlugin.initialize.mockClear();
|
||||||
|
fakePlugin.canHandleBuild.mockClear();
|
||||||
|
fakePlugin.handleBuild.mockClear();
|
||||||
|
fakePlugin.beforeLocalBuild.mockClear();
|
||||||
|
fakePlugin.afterLocalBuild.mockClear();
|
||||||
|
fakePlugin.handlePostBuild.mockClear();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns the plugin from createPlugin()', async () => {
|
||||||
|
installOrchestratorMock();
|
||||||
|
const { loadOrchestratorPlugin } = await import('./orchestrator-plugin');
|
||||||
|
|
||||||
|
const plugin = await loadOrchestratorPlugin();
|
||||||
|
|
||||||
|
expect(plugin).toBeDefined();
|
||||||
|
expect(mockCreatePlugin).toHaveBeenCalledTimes(1);
|
||||||
|
expect(plugin).toBe(fakePlugin);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns the plugin with all lifecycle methods', async () => {
|
||||||
|
installOrchestratorMock();
|
||||||
|
const { loadOrchestratorPlugin } = await import('./orchestrator-plugin');
|
||||||
|
|
||||||
|
const plugin = await loadOrchestratorPlugin();
|
||||||
|
|
||||||
|
expect(typeof plugin!.initialize).toBe('function');
|
||||||
|
expect(typeof plugin!.canHandleBuild).toBe('function');
|
||||||
|
expect(typeof plugin!.handleBuild).toBe('function');
|
||||||
|
expect(typeof plugin!.beforeLocalBuild).toBe('function');
|
||||||
|
expect(typeof plugin!.afterLocalBuild).toBe('function');
|
||||||
|
expect(typeof plugin!.handlePostBuild).toBe('function');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns undefined and warns when createPlugin is not a function', async () => {
|
||||||
|
installOrchestratorMock({ createPlugin: undefined });
|
||||||
|
const { loadOrchestratorPlugin } = await import('./orchestrator-plugin');
|
||||||
|
|
||||||
|
const plugin = await loadOrchestratorPlugin();
|
||||||
|
|
||||||
|
expect(plugin).toBeUndefined();
|
||||||
|
expect(mockWarning).toHaveBeenCalledWith(expect.stringContaining('does not export createPlugin'));
|
||||||
|
});
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------
|
||||||
|
// Error handling
|
||||||
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
|
describe('error handling', () => {
|
||||||
|
it('propagates non-MODULE_NOT_FOUND errors', async () => {
|
||||||
|
const importError = new Error('Syntax error in module');
|
||||||
|
jest.doMock(
|
||||||
|
'@game-ci/orchestrator',
|
||||||
|
() => {
|
||||||
|
throw importError;
|
||||||
|
},
|
||||||
|
{ virtual: true },
|
||||||
|
);
|
||||||
|
const { loadOrchestratorPlugin } = await import('./orchestrator-plugin');
|
||||||
|
|
||||||
|
await expect(loadOrchestratorPlugin()).rejects.toThrow('Syntax error in module');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,2 +1,73 @@
|
|||||||
export { loadPlugin as loadOrchestratorPlugin } from './plugin';
|
import * as core from '@actions/core';
|
||||||
export type { Plugin as OrchestratorPlugin } from './plugin';
|
|
||||||
|
/**
|
||||||
|
* Lifecycle interface for the orchestrator plugin.
|
||||||
|
*
|
||||||
|
* The orchestrator reads its own configuration from environment variables
|
||||||
|
* and GitHub Actions inputs. Unity-builder only calls these lifecycle hooks
|
||||||
|
* at the appropriate times — it never needs to know individual plugin params.
|
||||||
|
*/
|
||||||
|
export interface OrchestratorPlugin {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
initialize(coreParameters: Record<string, any>, workspace: string): Promise<void>;
|
||||||
|
|
||||||
|
/** Whether the plugin wants to handle the entire build (remote, hot runner, test workflow). */
|
||||||
|
canHandleBuild(): boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the build when canHandleBuild() returns true.
|
||||||
|
* If the plugin needs to fall back to a local build (e.g. hot runner failure),
|
||||||
|
* it returns { exitCode: -1, fallbackToLocal: true }.
|
||||||
|
*/
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
handleBuild(baseImage: string): Promise<{ exitCode: number; fallbackToLocal?: boolean }>;
|
||||||
|
|
||||||
|
/** Pre-build hook for local builds (cache restore, git hooks, sync, etc.). */
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
beforeLocalBuild(workspace: string): Promise<void>;
|
||||||
|
|
||||||
|
/** Post-build hook for local builds (cache save, workspace save, etc.). */
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
afterLocalBuild(workspace: string, exitCode: number): Promise<void>;
|
||||||
|
|
||||||
|
/** Post-build hook for all build types (archiving, artifacts, etc.). */
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
handlePostBuild(exitCode: number): Promise<void>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempt to load the orchestrator plugin.
|
||||||
|
* Returns undefined if @game-ci/orchestrator is not installed.
|
||||||
|
*/
|
||||||
|
export async function loadOrchestratorPlugin(): Promise<OrchestratorPlugin | undefined> {
|
||||||
|
try {
|
||||||
|
// eslint-disable-next-line import/no-unresolved
|
||||||
|
const orchestratorModule = await import('@game-ci/orchestrator');
|
||||||
|
|
||||||
|
if (typeof orchestratorModule.createPlugin !== 'function') {
|
||||||
|
core.warning(
|
||||||
|
'Orchestrator package found but does not export createPlugin(). ' +
|
||||||
|
'Update @game-ci/orchestrator to the latest version.',
|
||||||
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return orchestratorModule.createPlugin();
|
||||||
|
} catch (error) {
|
||||||
|
if (!isModuleNotFoundError(error)) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isModuleNotFoundError(error: unknown): boolean {
|
||||||
|
if (error && typeof error === 'object' && 'code' in error) {
|
||||||
|
const code = (error as { code: string }).code;
|
||||||
|
if (code === 'MODULE_NOT_FOUND' || code === 'ERR_MODULE_NOT_FOUND') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return typeof (error as Error)?.message === 'string' && /cannot find module/i.test((error as Error).message);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import Output from './output';
|
import Output from './output';
|
||||||
|
|
||||||
describe('Output', () => {
|
describe('Output', () => {
|
||||||
|
|||||||
@@ -4,30 +4,17 @@ import { BuildParameters } from '..';
|
|||||||
|
|
||||||
class SetupAndroid {
|
class SetupAndroid {
|
||||||
public static async setup(buildParameters: BuildParameters) {
|
public static async setup(buildParameters: BuildParameters) {
|
||||||
const { targetPlatform, androidKeystoreBase64, androidKeystoreName, projectPath } =
|
const { targetPlatform, androidKeystoreBase64, androidKeystoreName, projectPath } = buildParameters;
|
||||||
buildParameters;
|
|
||||||
|
|
||||||
if (
|
if (targetPlatform === 'Android' && androidKeystoreBase64 !== '' && androidKeystoreName !== '') {
|
||||||
targetPlatform === 'Android' &&
|
|
||||||
androidKeystoreBase64 !== '' &&
|
|
||||||
androidKeystoreName !== ''
|
|
||||||
) {
|
|
||||||
SetupAndroid.setupAndroidRun(androidKeystoreBase64, androidKeystoreName, projectPath);
|
SetupAndroid.setupAndroidRun(androidKeystoreBase64, androidKeystoreName, projectPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static setupAndroidRun(
|
private static setupAndroidRun(androidKeystoreBase64: string, androidKeystoreName: string, projectPath: string) {
|
||||||
androidKeystoreBase64: string,
|
|
||||||
androidKeystoreName: string,
|
|
||||||
projectPath: string,
|
|
||||||
) {
|
|
||||||
const decodedKeystore = Buffer.from(androidKeystoreBase64, 'base64').toString('binary');
|
const decodedKeystore = Buffer.from(androidKeystoreBase64, 'base64').toString('binary');
|
||||||
const githubWorkspace = process.env.GITHUB_WORKSPACE || '';
|
const githubWorkspace = process.env.GITHUB_WORKSPACE || '';
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(path.join(githubWorkspace, projectPath, androidKeystoreName), decodedKeystore, 'binary');
|
||||||
path.join(githubWorkspace, projectPath, androidKeystoreName),
|
|
||||||
decodedKeystore,
|
|
||||||
'binary',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ class SetupMac {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const commandSuffix =
|
const commandSuffix = buildParameters.unityHubVersionOnMac !== '' ? `@${buildParameters.unityHubVersionOnMac}` : '';
|
||||||
buildParameters.unityHubVersionOnMac !== '' ? `@${buildParameters.unityHubVersionOnMac}` : '';
|
|
||||||
const command = `brew install unity-hub${commandSuffix}`;
|
const command = `brew install unity-hub${commandSuffix}`;
|
||||||
|
|
||||||
// Ignoring return code because the log seems to overflow the internal buffer which triggers
|
// Ignoring return code because the log seems to overflow the internal buffer which triggers
|
||||||
@@ -53,9 +52,7 @@ class SetupMac {
|
|||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
});
|
});
|
||||||
if (errorCode) {
|
if (errorCode) {
|
||||||
throw new Error(
|
throw new Error(`There was an error installing the Unity Editor. See logs above for details.`);
|
||||||
`There was an error installing the Unity Editor. See logs above for details.`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildParameters.cacheUnityInstallationOnMac) {
|
if (buildParameters.cacheUnityInstallationOnMac) {
|
||||||
@@ -138,9 +135,7 @@ class SetupMac {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const unityChangeset = await getUnityChangeset(buildParameters.editorVersion);
|
const unityChangeset = await getUnityChangeset(buildParameters.editorVersion);
|
||||||
const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(
|
const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
|
||||||
buildParameters.targetPlatform,
|
|
||||||
);
|
|
||||||
const architectureArguments = SetupMac.getArchitectureParameters();
|
const architectureArguments = SetupMac.getArchitectureParameters();
|
||||||
|
|
||||||
const execArguments: string[] = [
|
const execArguments: string[] = [
|
||||||
@@ -161,9 +156,7 @@ class SetupMac {
|
|||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
});
|
});
|
||||||
if (errorCode) {
|
if (errorCode) {
|
||||||
throw new Error(
|
throw new Error(`There was an error installing the Unity Editor. See logs above for details.`);
|
||||||
`There was an error installing the Unity Editor. See logs above for details.`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildParameters.cacheUnityInstallationOnMac) {
|
if (buildParameters.cacheUnityInstallationOnMac) {
|
||||||
@@ -171,10 +164,7 @@ class SetupMac {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async setEnvironmentVariables(
|
private static async setEnvironmentVariables(buildParameters: BuildParameters, actionFolder: string) {
|
||||||
buildParameters: BuildParameters,
|
|
||||||
actionFolder: string,
|
|
||||||
) {
|
|
||||||
// Need to set environment variables from here because we execute
|
// Need to set environment variables from here because we execute
|
||||||
// the scripts on the host for mac
|
// the scripts on the host for mac
|
||||||
process.env.ACTION_FOLDER = actionFolder;
|
process.env.ACTION_FOLDER = actionFolder;
|
||||||
|
|||||||
@@ -42,9 +42,7 @@ class ValidateWindows {
|
|||||||
|
|
||||||
private static checkForVisualStudio() {
|
private static checkForVisualStudio() {
|
||||||
// Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
|
// Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
|
||||||
const visualStudioInstallPathExists = fs.existsSync(
|
const visualStudioInstallPathExists = fs.existsSync('C:/Program Files (x86)/Microsoft Visual Studio');
|
||||||
'C:/Program Files (x86)/Microsoft Visual Studio',
|
|
||||||
);
|
|
||||||
const visualStudioDataPathExists = fs.existsSync('C:/ProgramData/Microsoft/VisualStudio');
|
const visualStudioDataPathExists = fs.existsSync('C:/ProgramData/Microsoft/VisualStudio');
|
||||||
|
|
||||||
if (!visualStudioInstallPathExists || !visualStudioDataPathExists) {
|
if (!visualStudioInstallPathExists || !visualStudioDataPathExists) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import Platform from './platform';
|
import Platform from './platform';
|
||||||
|
|
||||||
describe('Platform', () => {
|
describe('Platform', () => {
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for the generic plugin loader (plugin.ts).
|
|
||||||
*
|
|
||||||
* The default plugin implementation is currently @game-ci/orchestrator, but
|
|
||||||
* unity-builder depends on the generic Plugin lifecycle rather than an
|
|
||||||
* orchestrator-specific type.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const mockWarning = vi.fn();
|
|
||||||
const mockInfo = vi.fn();
|
|
||||||
vi.mock('@actions/core', () => ({
|
|
||||||
warning: mockWarning,
|
|
||||||
info: mockInfo,
|
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
vi.resetModules();
|
|
||||||
mockWarning.mockClear();
|
|
||||||
mockInfo.mockClear();
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('plugin (default package not installed)', () => {
|
|
||||||
it('loadPlugin() returns undefined', async () => {
|
|
||||||
const { loadPlugin } = await import('./plugin');
|
|
||||||
|
|
||||||
const result = await loadPlugin();
|
|
||||||
|
|
||||||
expect(result).toBeUndefined();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('plugin (default package installed)', () => {
|
|
||||||
const fakePlugin = {
|
|
||||||
initialize: vi.fn(),
|
|
||||||
canHandleBuild: vi.fn().mockReturnValue(false),
|
|
||||||
handleBuild: vi.fn().mockResolvedValue({ exitCode: 0 }),
|
|
||||||
beforeLocalBuild: vi.fn(),
|
|
||||||
afterLocalBuild: vi.fn(),
|
|
||||||
handlePostBuild: vi.fn(),
|
|
||||||
};
|
|
||||||
|
|
||||||
const mockCreatePlugin = vi.fn().mockReturnValue(fakePlugin);
|
|
||||||
|
|
||||||
function installDefaultPluginMock(overrides: Record<string, unknown> = {}) {
|
|
||||||
// The `@game-ci/orchestrator` module is intentionally optional and may not
|
|
||||||
// be installed. `vi.doMock` lets the dynamic import in the loader resolve
|
|
||||||
// through this factory before vite tries to load a real package.
|
|
||||||
vi.doMock('@game-ci/orchestrator', () => ({
|
|
||||||
createPlugin: mockCreatePlugin,
|
|
||||||
...overrides,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
mockCreatePlugin.mockClear();
|
|
||||||
fakePlugin.initialize.mockClear();
|
|
||||||
fakePlugin.canHandleBuild.mockClear();
|
|
||||||
fakePlugin.handleBuild.mockClear();
|
|
||||||
fakePlugin.beforeLocalBuild.mockClear();
|
|
||||||
fakePlugin.afterLocalBuild.mockClear();
|
|
||||||
fakePlugin.handlePostBuild.mockClear();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns the plugin from createPlugin()', async () => {
|
|
||||||
installDefaultPluginMock();
|
|
||||||
const { loadPlugin } = await import('./plugin');
|
|
||||||
|
|
||||||
const plugin = await loadPlugin();
|
|
||||||
|
|
||||||
expect(plugin).toBeDefined();
|
|
||||||
expect(mockCreatePlugin).toHaveBeenCalledTimes(1);
|
|
||||||
expect(plugin).toBe(fakePlugin);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns a plugin with all lifecycle methods', async () => {
|
|
||||||
installDefaultPluginMock();
|
|
||||||
const { loadPlugin } = await import('./plugin');
|
|
||||||
|
|
||||||
const plugin = await loadPlugin();
|
|
||||||
|
|
||||||
expect(typeof plugin!.initialize).toBe('function');
|
|
||||||
expect(typeof plugin!.canHandleBuild).toBe('function');
|
|
||||||
expect(typeof plugin!.handleBuild).toBe('function');
|
|
||||||
expect(typeof plugin!.beforeLocalBuild).toBe('function');
|
|
||||||
expect(typeof plugin!.afterLocalBuild).toBe('function');
|
|
||||||
expect(typeof plugin!.handlePostBuild).toBe('function');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns undefined and warns when createPlugin is not a function', async () => {
|
|
||||||
installDefaultPluginMock({ createPlugin: undefined });
|
|
||||||
const { loadPlugin } = await import('./plugin');
|
|
||||||
|
|
||||||
const plugin = await loadPlugin();
|
|
||||||
|
|
||||||
expect(plugin).toBeUndefined();
|
|
||||||
expect(mockWarning).toHaveBeenCalledWith(
|
|
||||||
expect.stringContaining('does not export createPlugin'),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('propagates non-MODULE_NOT_FOUND errors', async () => {
|
|
||||||
// Throw lazily from `createPlugin` rather than from the mock factory
|
|
||||||
// itself: vitest 4 wraps factory-time errors with its own message, which
|
|
||||||
// masks the inner error at the assertion site.
|
|
||||||
installDefaultPluginMock({
|
|
||||||
createPlugin: () => {
|
|
||||||
throw new Error('Syntax error in module');
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const { loadPlugin } = await import('./plugin');
|
|
||||||
|
|
||||||
await expect(loadPlugin()).rejects.toThrow('Syntax error in module');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
const DEFAULT_PLUGIN_MODULE = '@game-ci/orchestrator';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generic lifecycle contract for optional unity-builder plugins.
|
|
||||||
*
|
|
||||||
* Plugins read their own configuration from environment variables and GitHub
|
|
||||||
* Actions inputs. Unity-builder only calls lifecycle hooks at the points where
|
|
||||||
* an external implementation can extend or replace the local build flow.
|
|
||||||
*/
|
|
||||||
export interface Plugin {
|
|
||||||
initialize(coreParameters: Record<string, any>, workspace: string): Promise<void>;
|
|
||||||
|
|
||||||
/** Whether the plugin wants to handle the entire build. */
|
|
||||||
canHandleBuild(): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the build when canHandleBuild() returns true.
|
|
||||||
* If the plugin needs to fall back to a local build, it returns
|
|
||||||
* { exitCode: -1, fallbackToLocal: true }.
|
|
||||||
*/
|
|
||||||
handleBuild(baseImage: string): Promise<{ exitCode: number; fallbackToLocal?: boolean }>;
|
|
||||||
|
|
||||||
/** Pre-build hook for local builds. */
|
|
||||||
beforeLocalBuild(workspace: string): Promise<void>;
|
|
||||||
|
|
||||||
/** Post-build hook for local builds. */
|
|
||||||
afterLocalBuild(workspace: string, exitCode: number): Promise<void>;
|
|
||||||
|
|
||||||
/** Post-build hook for all build types. */
|
|
||||||
handlePostBuild(exitCode: number): Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Attempt to load the default optional plugin.
|
|
||||||
*
|
|
||||||
* Today the default implementation is @game-ci/orchestrator. The loader is
|
|
||||||
* intentionally named after the generic plugin contract so additional plugin
|
|
||||||
* implementations can be added without making orchestrator part of the core
|
|
||||||
* abstraction.
|
|
||||||
*/
|
|
||||||
export async function loadPlugin(moduleName = DEFAULT_PLUGIN_MODULE): Promise<Plugin | undefined> {
|
|
||||||
try {
|
|
||||||
const pluginModule = await import(/* webpackIgnore: true */ moduleName);
|
|
||||||
|
|
||||||
if (typeof pluginModule.createPlugin !== 'function') {
|
|
||||||
core.warning(
|
|
||||||
`Plugin package "${moduleName}" found but does not export createPlugin(). ` +
|
|
||||||
'Update the plugin package to the latest version.',
|
|
||||||
);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return pluginModule.createPlugin();
|
|
||||||
} catch (error) {
|
|
||||||
if (!isModuleNotFoundError(error)) {
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function isModuleNotFoundError(error: unknown): boolean {
|
|
||||||
if (error && typeof error === 'object' && 'code' in error) {
|
|
||||||
const code = (error as { code: string }).code;
|
|
||||||
if (code === 'MODULE_NOT_FOUND' || code === 'ERR_MODULE_NOT_FOUND') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
typeof (error as Error)?.message === 'string' &&
|
|
||||||
/cannot find module/i.test((error as Error).message)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import { describe, it, expect, beforeEach, afterEach, beforeAll, afterAll, vi } from 'vitest';
|
|
||||||
import Project from './project';
|
import Project from './project';
|
||||||
|
|
||||||
vi.mock('./input');
|
jest.mock('./input');
|
||||||
|
|
||||||
describe('Platform', () => {
|
describe('Platform', () => {
|
||||||
describe('relativePath', () => {
|
describe('relativePath', () => {
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { describe, it, expect, beforeEach, afterEach, beforeAll, afterAll, vi } from 'vitest';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import System from './system';
|
import System from './system';
|
||||||
|
|
||||||
vi.spyOn(core, 'debug').mockImplementation(() => {});
|
jest.spyOn(core, 'debug').mockImplementation(() => {});
|
||||||
vi.spyOn(core, 'info').mockImplementation(() => {});
|
jest.spyOn(core, 'info').mockImplementation(() => {});
|
||||||
vi.spyOn(core, 'warning').mockImplementation(() => {});
|
jest.spyOn(core, 'warning').mockImplementation(() => {});
|
||||||
vi.spyOn(core, 'error').mockImplementation(() => {});
|
jest.spyOn(core, 'error').mockImplementation(() => {});
|
||||||
|
|
||||||
afterEach(() => vi.clearAllMocks());
|
afterEach(() => jest.clearAllMocks());
|
||||||
|
|
||||||
describe('System', () => {
|
describe('System', () => {
|
||||||
describe('run', () => {
|
describe('run', () => {
|
||||||
|
|||||||
@@ -1,26 +1,21 @@
|
|||||||
import { describe, it, expect, beforeEach, afterEach, beforeAll, afterAll, vi } from 'vitest';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as exec from '@actions/exec';
|
import * as exec from '@actions/exec';
|
||||||
import System from './system';
|
import System from './system';
|
||||||
|
|
||||||
vi.spyOn(core, 'debug').mockImplementation(() => {});
|
jest.spyOn(core, 'debug').mockImplementation(() => {});
|
||||||
const info = vi.spyOn(core, 'info').mockImplementation(() => {});
|
const info = jest.spyOn(core, 'info').mockImplementation(() => {});
|
||||||
vi.spyOn(core, 'warning').mockImplementation(() => {});
|
jest.spyOn(core, 'warning').mockImplementation(() => {});
|
||||||
vi.spyOn(core, 'error').mockImplementation(() => {});
|
jest.spyOn(core, 'error').mockImplementation(() => {});
|
||||||
const execSpy = vi.spyOn(exec, 'exec').mockImplementation(async () => 0);
|
const execSpy = jest.spyOn(exec, 'exec').mockImplementation(async () => 0);
|
||||||
|
|
||||||
afterEach(() => vi.clearAllMocks());
|
afterEach(() => jest.clearAllMocks());
|
||||||
|
|
||||||
describe('System', () => {
|
describe('System', () => {
|
||||||
describe('run', () => {
|
describe('run', () => {
|
||||||
describe('units', () => {
|
describe('units', () => {
|
||||||
it('passes the command to command line', async () => {
|
it('passes the command to command line', async () => {
|
||||||
await expect(System.run('echo test')).resolves.not.toBeNull();
|
await expect(System.run('echo test')).resolves.not.toBeNull();
|
||||||
await expect(execSpy).toHaveBeenLastCalledWith(
|
await expect(execSpy).toHaveBeenLastCalledWith('echo test', expect.anything(), expect.anything());
|
||||||
'echo test',
|
|
||||||
expect.anything(),
|
|
||||||
expect.anything(),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws on when error code is not 0', async () => {
|
it('throws on when error code is not 0', async () => {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect, vi, beforeEach, afterEach, beforeAll, afterAll, test } from 'vitest';
|
|
||||||
import UnityVersioning from './unity-versioning';
|
import UnityVersioning from './unity-versioning';
|
||||||
|
|
||||||
describe('Unity Versioning', () => {
|
describe('Unity Versioning', () => {
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ export default class UnityVersioning {
|
|||||||
static read(projectPath: string) {
|
static read(projectPath: string) {
|
||||||
const filePath = path.join(projectPath, 'ProjectSettings', 'ProjectVersion.txt');
|
const filePath = path.join(projectPath, 'ProjectSettings', 'ProjectVersion.txt');
|
||||||
if (!fs.existsSync(filePath)) {
|
if (!fs.existsSync(filePath)) {
|
||||||
throw new Error(
|
throw new Error(`Project settings file not found at "${filePath}". Have you correctly set the projectPath?`);
|
||||||
`Project settings file not found at "${filePath}". Have you correctly set the projectPath?`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return UnityVersioning.parse(fs.readFileSync(filePath, 'utf8'));
|
return UnityVersioning.parse(fs.readFileSync(filePath, 'utf8'));
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { describe, it, expect } from 'vitest';
|
|
||||||
import Unity from './unity';
|
import Unity from './unity';
|
||||||
|
|
||||||
describe('Unity', () => {
|
describe('Unity', () => {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, test, vi } from 'vitest';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import NotImplementedException from './error/not-implemented-exception';
|
import NotImplementedException from './error/not-implemented-exception';
|
||||||
import System from './system';
|
import System from './system';
|
||||||
@@ -6,7 +5,7 @@ import Versioning from './versioning';
|
|||||||
import { validVersionTagInputs, invalidVersionTagInputs } from './__data__/versions';
|
import { validVersionTagInputs, invalidVersionTagInputs } from './__data__/versions';
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.restoreAllMocks();
|
jest.restoreAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Versioning', () => {
|
describe('Versioning', () => {
|
||||||
@@ -40,9 +39,7 @@ describe('Versioning', () => {
|
|||||||
// eslint-disable-next-line unicorn/consistent-function-scoping
|
// eslint-disable-next-line unicorn/consistent-function-scoping
|
||||||
const matchInputUsingGrep = async (input: string) => {
|
const matchInputUsingGrep = async (input: string) => {
|
||||||
const output = await System.run('sh', undefined, {
|
const output = await System.run('sh', undefined, {
|
||||||
input: Buffer.from(
|
input: Buffer.from(`echo '${input}' | grep -E '${Versioning.grepCompatibleInputVersionRegex}'`),
|
||||||
`echo '${input}' | grep -E '${Versioning.grepCompatibleInputVersionRegex}'`,
|
|
||||||
),
|
|
||||||
silent: true,
|
silent: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -53,39 +50,30 @@ describe('Versioning', () => {
|
|||||||
expect(await matchInputUsingGrep(input)).toStrictEqual(input);
|
expect(await matchInputUsingGrep(input)).toStrictEqual(input);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.concurrent.each(invalidVersionTagInputs)(
|
it.concurrent.each(invalidVersionTagInputs)(`rejects non-version tag input '%s'`, async (input) => {
|
||||||
`rejects non-version tag input '%s'`,
|
await expect(async () => matchInputUsingGrep(input)).rejects.toThrowError(/^Failed to run/);
|
||||||
async (input) => {
|
});
|
||||||
await expect(async () => matchInputUsingGrep(input)).rejects.toThrowError(/^Failed to run/);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('branch', () => {
|
describe('branch', () => {
|
||||||
it('returns headRef when set', () => {
|
it('returns headRef when set', () => {
|
||||||
const headReference = vi
|
const headReference = jest.spyOn(Versioning, 'headRef', 'get').mockReturnValue('feature-branch-1');
|
||||||
.spyOn(Versioning, 'headRef', 'get')
|
|
||||||
.mockReturnValue('feature-branch-1');
|
|
||||||
|
|
||||||
expect(Versioning.branch).toStrictEqual('feature-branch-1');
|
expect(Versioning.branch).toStrictEqual('feature-branch-1');
|
||||||
expect(headReference).toHaveBeenCalledTimes(1);
|
expect(headReference).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns part of Ref when set', () => {
|
it('returns part of Ref when set', () => {
|
||||||
vi.spyOn(Versioning, 'headRef', 'get').mockImplementation(() => undefined);
|
jest.spyOn(Versioning, 'headRef', 'get').mockImplementation();
|
||||||
const reference = vi
|
const reference = jest.spyOn(Versioning, 'ref', 'get').mockReturnValue('refs/heads/feature-branch-2');
|
||||||
.spyOn(Versioning, 'ref', 'get')
|
|
||||||
.mockReturnValue('refs/heads/feature-branch-2');
|
|
||||||
|
|
||||||
expect(Versioning.branch).toStrictEqual('feature-branch-2');
|
expect(Versioning.branch).toStrictEqual('feature-branch-2');
|
||||||
expect(reference).toHaveBeenCalledTimes(1);
|
expect(reference).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('prefers headRef over ref when set', () => {
|
it('prefers headRef over ref when set', () => {
|
||||||
const headReference = vi
|
const headReference = jest.spyOn(Versioning, 'headRef', 'get').mockReturnValue('feature-branch-1');
|
||||||
.spyOn(Versioning, 'headRef', 'get')
|
const reference = jest.spyOn(Versioning, 'ref', 'get').mockReturnValue('refs/heads/feature-2');
|
||||||
.mockReturnValue('feature-branch-1');
|
|
||||||
const reference = vi.spyOn(Versioning, 'ref', 'get').mockReturnValue('refs/heads/feature-2');
|
|
||||||
|
|
||||||
expect(Versioning.branch).toStrictEqual('feature-branch-1');
|
expect(Versioning.branch).toStrictEqual('feature-branch-1');
|
||||||
expect(headReference).toHaveBeenCalledTimes(1);
|
expect(headReference).toHaveBeenCalledTimes(1);
|
||||||
@@ -93,10 +81,8 @@ describe('Versioning', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns undefined when headRef and ref are not set', () => {
|
it('returns undefined when headRef and ref are not set', () => {
|
||||||
const headReference = vi
|
const headReference = jest.spyOn(Versioning, 'headRef', 'get').mockImplementation();
|
||||||
.spyOn(Versioning, 'headRef', 'get')
|
const reference = jest.spyOn(Versioning, 'ref', 'get').mockImplementation();
|
||||||
.mockImplementation(() => undefined);
|
|
||||||
const reference = vi.spyOn(Versioning, 'ref', 'get').mockImplementation(() => undefined);
|
|
||||||
|
|
||||||
expect(Versioning.branch).not.toBeDefined();
|
expect(Versioning.branch).not.toBeDefined();
|
||||||
|
|
||||||
@@ -120,19 +106,16 @@ describe('Versioning', () => {
|
|||||||
describe('logging git diff', () => {
|
describe('logging git diff', () => {
|
||||||
it('calls git diff', async () => {
|
it('calls git diff', async () => {
|
||||||
// allowDirtyBuild: true
|
// allowDirtyBuild: true
|
||||||
vi.spyOn(core, 'getInput').mockReturnValue('true');
|
jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||||
vi.spyOn(Versioning, 'isShallow').mockResolvedValue(true);
|
jest.spyOn(Versioning, 'isShallow').mockResolvedValue(true);
|
||||||
vi.spyOn(Versioning, 'isDirty').mockResolvedValue(false);
|
jest.spyOn(Versioning, 'isDirty').mockResolvedValue(false);
|
||||||
vi.spyOn(Versioning, 'fetch').mockResolvedValue();
|
jest.spyOn(Versioning, 'fetch').mockImplementation();
|
||||||
vi.spyOn(Versioning, 'hasAnyVersionTags').mockResolvedValue(true);
|
jest.spyOn(Versioning, 'hasAnyVersionTags').mockResolvedValue(true);
|
||||||
vi.spyOn(Versioning, 'parseSemanticVersion').mockResolvedValue({
|
jest
|
||||||
match: '',
|
.spyOn(Versioning, 'parseSemanticVersion')
|
||||||
tag: 'mocktag',
|
.mockResolvedValue({ match: '', tag: 'mocktag', commits: 'abcdef', hash: '75822BCAF' });
|
||||||
commits: 'abcdef',
|
const logDiffSpy = jest.spyOn(Versioning, 'logDiff');
|
||||||
hash: '75822BCAF',
|
const gitSpy = jest.spyOn(System, 'run').mockImplementation();
|
||||||
});
|
|
||||||
const logDiffSpy = vi.spyOn(Versioning, 'logDiff');
|
|
||||||
const gitSpy = vi.spyOn(System, 'run').mockResolvedValue('');
|
|
||||||
|
|
||||||
await Versioning.generateSemanticVersion();
|
await Versioning.generateSemanticVersion();
|
||||||
|
|
||||||
@@ -174,16 +157,12 @@ describe('Versioning', () => {
|
|||||||
|
|
||||||
describe('determineBuildVersion', () => {
|
describe('determineBuildVersion', () => {
|
||||||
test.each(['somethingRandom'])('throws for invalid strategy %s', async (strategy) => {
|
test.each(['somethingRandom'])('throws for invalid strategy %s', async (strategy) => {
|
||||||
await expect(
|
await expect(Versioning.determineBuildVersion(strategy, '')).rejects.toThrowErrorMatchingSnapshot();
|
||||||
Versioning.determineBuildVersion(strategy, ''),
|
|
||||||
).rejects.toThrowErrorMatchingSnapshot();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('opt out strategy', () => {
|
describe('opt out strategy', () => {
|
||||||
it("returns 'none'", async () => {
|
it("returns 'none'", async () => {
|
||||||
await expect(
|
await expect(Versioning.determineBuildVersion('None', 'v1.0')).resolves.toMatchInlineSnapshot(`"none"`);
|
||||||
Versioning.determineBuildVersion('None', 'v1.0'),
|
|
||||||
).resolves.toMatchInlineSnapshot(`"none"`);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -191,31 +170,23 @@ describe('Versioning', () => {
|
|||||||
test.each(['v0.1', '1', 'CamelCase', 'dashed-version'])(
|
test.each(['v0.1', '1', 'CamelCase', 'dashed-version'])(
|
||||||
'returns the inputVersion for %s',
|
'returns the inputVersion for %s',
|
||||||
async (inputVersion) => {
|
async (inputVersion) => {
|
||||||
await expect(
|
await expect(Versioning.determineBuildVersion('Custom', inputVersion)).resolves.toStrictEqual(inputVersion);
|
||||||
Versioning.determineBuildVersion('Custom', inputVersion),
|
|
||||||
).resolves.toStrictEqual(inputVersion);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('semantic strategy', () => {
|
describe('semantic strategy', () => {
|
||||||
it('refers to generateSemanticVersion', async () => {
|
it('refers to generateSemanticVersion', async () => {
|
||||||
const generateSemanticVersion = vi
|
const generateSemanticVersion = jest.spyOn(Versioning, 'generateSemanticVersion').mockResolvedValue('1.3.37');
|
||||||
.spyOn(Versioning, 'generateSemanticVersion')
|
|
||||||
.mockResolvedValue('1.3.37');
|
|
||||||
|
|
||||||
await expect(Versioning.determineBuildVersion('Semantic', '')).resolves.toStrictEqual(
|
await expect(Versioning.determineBuildVersion('Semantic', '')).resolves.toStrictEqual('1.3.37');
|
||||||
'1.3.37',
|
|
||||||
);
|
|
||||||
expect(generateSemanticVersion).toHaveBeenCalledTimes(1);
|
expect(generateSemanticVersion).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('tag strategy', () => {
|
describe('tag strategy', () => {
|
||||||
it('refers to generateTagVersion', async () => {
|
it('refers to generateTagVersion', async () => {
|
||||||
const generateTagVersion = vi
|
const generateTagVersion = jest.spyOn(Versioning, 'generateTagVersion').mockResolvedValue('0.1');
|
||||||
.spyOn(Versioning, 'generateTagVersion')
|
|
||||||
.mockResolvedValue('0.1');
|
|
||||||
|
|
||||||
await expect(Versioning.determineBuildVersion('Tag', '')).resolves.toStrictEqual('0.1');
|
await expect(Versioning.determineBuildVersion('Tag', '')).resolves.toStrictEqual('0.1');
|
||||||
expect(generateTagVersion).toHaveBeenCalledTimes(1);
|
expect(generateTagVersion).toHaveBeenCalledTimes(1);
|
||||||
@@ -226,24 +197,22 @@ describe('Versioning', () => {
|
|||||||
it('throws a not implemented exception', async () => {
|
it('throws a not implemented exception', async () => {
|
||||||
const strategy = 'Test';
|
const strategy = 'Test';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
vi.spyOn(Versioning, 'strategies', 'get').mockReturnValue({ [strategy]: strategy });
|
jest.spyOn(Versioning, 'strategies', 'get').mockReturnValue({ [strategy]: strategy });
|
||||||
await expect(Versioning.determineBuildVersion(strategy, '')).rejects.toThrowError(
|
await expect(Versioning.determineBuildVersion(strategy, '')).rejects.toThrowError(NotImplementedException);
|
||||||
NotImplementedException,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('generateTagVersion', () => {
|
describe('generateTagVersion', () => {
|
||||||
it('removes the v', async () => {
|
it('removes the v', async () => {
|
||||||
vi.spyOn(Versioning, 'getTag').mockResolvedValue('v1.3.37');
|
jest.spyOn(Versioning, 'getTag').mockResolvedValue('v1.3.37');
|
||||||
await expect(Versioning.generateTagVersion()).resolves.toStrictEqual('1.3.37');
|
await expect(Versioning.generateTagVersion()).resolves.toStrictEqual('1.3.37');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('parseSemanticVersion', () => {
|
describe('parseSemanticVersion', () => {
|
||||||
it('returns the named parts', async () => {
|
it('returns the named parts', async () => {
|
||||||
vi.spyOn(Versioning, 'getVersionDescription').mockResolvedValue('v0.1-2-g12345678');
|
jest.spyOn(Versioning, 'getVersionDescription').mockResolvedValue('v0.1-2-g12345678');
|
||||||
|
|
||||||
await expect(Versioning.parseSemanticVersion()).resolves.toMatchObject({
|
await expect(Versioning.parseSemanticVersion()).resolves.toMatchObject({
|
||||||
tag: '0.1',
|
tag: '0.1',
|
||||||
@@ -253,7 +222,7 @@ describe('Versioning', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('throws when no match could be made', async () => {
|
it('throws when no match could be made', async () => {
|
||||||
vi.spyOn(Versioning, 'getVersionDescription').mockResolvedValue('no-match-can-be-made');
|
jest.spyOn(Versioning, 'getVersionDescription').mockResolvedValue('no-match-can-be-made');
|
||||||
|
|
||||||
await expect(Versioning.parseSemanticVersion()).toMatchObject({});
|
await expect(Versioning.parseSemanticVersion()).toMatchObject({});
|
||||||
});
|
});
|
||||||
@@ -262,7 +231,7 @@ describe('Versioning', () => {
|
|||||||
describe('getVersionDescription', () => {
|
describe('getVersionDescription', () => {
|
||||||
it('returns the commands output', async () => {
|
it('returns the commands output', async () => {
|
||||||
const runOutput = 'someValue';
|
const runOutput = 'someValue';
|
||||||
vi.spyOn(System, 'run').mockResolvedValue(runOutput);
|
jest.spyOn(System, 'run').mockResolvedValue(runOutput);
|
||||||
await expect(Versioning.getVersionDescription()).resolves.toStrictEqual(runOutput);
|
await expect(Versioning.getVersionDescription()).resolves.toStrictEqual(runOutput);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -270,27 +239,27 @@ describe('Versioning', () => {
|
|||||||
describe('isShallow', () => {
|
describe('isShallow', () => {
|
||||||
it('returns true when the repo is shallow', async () => {
|
it('returns true when the repo is shallow', async () => {
|
||||||
const runOutput = 'true\n';
|
const runOutput = 'true\n';
|
||||||
vi.spyOn(System, 'run').mockResolvedValue(runOutput);
|
jest.spyOn(System, 'run').mockResolvedValue(runOutput);
|
||||||
await expect(Versioning.isShallow()).resolves.toStrictEqual(true);
|
await expect(Versioning.isShallow()).resolves.toStrictEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when the repo is not shallow', async () => {
|
it('returns false when the repo is not shallow', async () => {
|
||||||
const runOutput = 'false\n';
|
const runOutput = 'false\n';
|
||||||
vi.spyOn(System, 'run').mockResolvedValue(runOutput);
|
jest.spyOn(System, 'run').mockResolvedValue(runOutput);
|
||||||
await expect(Versioning.isShallow()).resolves.toStrictEqual(false);
|
await expect(Versioning.isShallow()).resolves.toStrictEqual(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('fetch', () => {
|
describe('fetch', () => {
|
||||||
it('awaits the command', async () => {
|
it('awaits the command', async () => {
|
||||||
vi.spyOn(core, 'warning').mockImplementation(() => {});
|
jest.spyOn(core, 'warning').mockImplementation(() => {});
|
||||||
vi.spyOn(System, 'run').mockResolvedValue('');
|
jest.spyOn(System, 'run').mockImplementation();
|
||||||
await expect(Versioning.fetch()).resolves.not.toThrow();
|
await expect(Versioning.fetch()).resolves.not.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('falls back to the second strategy when the first fails', async () => {
|
it('falls back to the second strategy when the first fails', async () => {
|
||||||
vi.spyOn(core, 'warning').mockImplementation(() => {});
|
jest.spyOn(core, 'warning').mockImplementation(() => {});
|
||||||
const gitFetch = vi.spyOn(System, 'run').mockResolvedValue('');
|
const gitFetch = jest.spyOn(System, 'run').mockImplementation();
|
||||||
|
|
||||||
await expect(Versioning.fetch()).resolves.not.toThrow();
|
await expect(Versioning.fetch()).resolves.not.toThrow();
|
||||||
expect(gitFetch).toHaveBeenCalledTimes(1);
|
expect(gitFetch).toHaveBeenCalledTimes(1);
|
||||||
@@ -299,12 +268,12 @@ describe('Versioning', () => {
|
|||||||
|
|
||||||
describe('generateSemanticVersion', () => {
|
describe('generateSemanticVersion', () => {
|
||||||
it('returns a proper version from description', async () => {
|
it('returns a proper version from description', async () => {
|
||||||
vi.spyOn(System, 'run').mockResolvedValue('');
|
jest.spyOn(System, 'run').mockImplementation();
|
||||||
vi.spyOn(core, 'info').mockImplementation(() => {});
|
jest.spyOn(core, 'info').mockImplementation(() => {});
|
||||||
vi.spyOn(Versioning, 'isDirty').mockResolvedValue(false);
|
jest.spyOn(Versioning, 'isDirty').mockResolvedValue(false);
|
||||||
vi.spyOn(Versioning, 'hasAnyVersionTags').mockResolvedValue(true);
|
jest.spyOn(Versioning, 'hasAnyVersionTags').mockResolvedValue(true);
|
||||||
vi.spyOn(Versioning, 'getTotalNumberOfCommits').mockResolvedValue(2);
|
jest.spyOn(Versioning, 'getTotalNumberOfCommits').mockResolvedValue(2);
|
||||||
vi.spyOn(Versioning, 'parseSemanticVersion').mockResolvedValue({
|
jest.spyOn(Versioning, 'parseSemanticVersion').mockResolvedValue({
|
||||||
match: '0.1-2-g1b345678',
|
match: '0.1-2-g1b345678',
|
||||||
tag: '0.1',
|
tag: '0.1',
|
||||||
commits: '2',
|
commits: '2',
|
||||||
@@ -315,19 +284,19 @@ describe('Versioning', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('throws when dirty', async () => {
|
it('throws when dirty', async () => {
|
||||||
vi.spyOn(System, 'run').mockResolvedValue('');
|
jest.spyOn(System, 'run').mockImplementation();
|
||||||
vi.spyOn(core, 'info').mockImplementation(() => {});
|
jest.spyOn(core, 'info').mockImplementation(() => {});
|
||||||
vi.spyOn(Versioning, 'isDirty').mockResolvedValue(true);
|
jest.spyOn(Versioning, 'isDirty').mockResolvedValue(true);
|
||||||
await expect(Versioning.generateSemanticVersion()).rejects.toThrowError();
|
await expect(Versioning.generateSemanticVersion()).rejects.toThrowError();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('falls back to commits only, when no tags are present', async () => {
|
it('falls back to commits only, when no tags are present', async () => {
|
||||||
const commits = Math.round(Math.random() * 10);
|
const commits = Math.round(Math.random() * 10);
|
||||||
vi.spyOn(System, 'run').mockResolvedValue('');
|
jest.spyOn(System, 'run').mockImplementation();
|
||||||
vi.spyOn(core, 'info').mockImplementation(() => {});
|
jest.spyOn(core, 'info').mockImplementation(() => {});
|
||||||
vi.spyOn(Versioning, 'isDirty').mockResolvedValue(false);
|
jest.spyOn(Versioning, 'isDirty').mockResolvedValue(false);
|
||||||
vi.spyOn(Versioning, 'hasAnyVersionTags').mockResolvedValue(false);
|
jest.spyOn(Versioning, 'hasAnyVersionTags').mockResolvedValue(false);
|
||||||
vi.spyOn(Versioning, 'getTotalNumberOfCommits').mockResolvedValue(commits);
|
jest.spyOn(Versioning, 'getTotalNumberOfCommits').mockResolvedValue(commits);
|
||||||
|
|
||||||
await expect(Versioning.generateSemanticVersion()).resolves.toStrictEqual(`0.0.${commits}`);
|
await expect(Versioning.generateSemanticVersion()).resolves.toStrictEqual(`0.0.${commits}`);
|
||||||
});
|
});
|
||||||
@@ -336,13 +305,13 @@ describe('Versioning', () => {
|
|||||||
describe('isDirty', () => {
|
describe('isDirty', () => {
|
||||||
it('returns true when there are files listed', async () => {
|
it('returns true when there are files listed', async () => {
|
||||||
const runOutput = 'file.ext\nfile2.ext';
|
const runOutput = 'file.ext\nfile2.ext';
|
||||||
vi.spyOn(System, 'run').mockResolvedValue(runOutput);
|
jest.spyOn(System, 'run').mockResolvedValue(runOutput);
|
||||||
await expect(Versioning.isDirty()).resolves.toStrictEqual(true);
|
await expect(Versioning.isDirty()).resolves.toStrictEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when there is no output', async () => {
|
it('returns false when there is no output', async () => {
|
||||||
const runOutput = '';
|
const runOutput = '';
|
||||||
vi.spyOn(System, 'run').mockResolvedValue(runOutput);
|
jest.spyOn(System, 'run').mockResolvedValue(runOutput);
|
||||||
await expect(Versioning.isDirty()).resolves.toStrictEqual(false);
|
await expect(Versioning.isDirty()).resolves.toStrictEqual(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -350,7 +319,7 @@ describe('Versioning', () => {
|
|||||||
describe('getTag', () => {
|
describe('getTag', () => {
|
||||||
it('returns the commands output', async () => {
|
it('returns the commands output', async () => {
|
||||||
const runOutput = 'v1.0';
|
const runOutput = 'v1.0';
|
||||||
vi.spyOn(System, 'run').mockResolvedValue(runOutput);
|
jest.spyOn(System, 'run').mockResolvedValue(runOutput);
|
||||||
await expect(Versioning.getTag()).resolves.toStrictEqual(runOutput);
|
await expect(Versioning.getTag()).resolves.toStrictEqual(runOutput);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -358,20 +327,20 @@ describe('Versioning', () => {
|
|||||||
describe('hasAnyVersionTags', () => {
|
describe('hasAnyVersionTags', () => {
|
||||||
it('returns false when the command returns 0', async () => {
|
it('returns false when the command returns 0', async () => {
|
||||||
const runOutput = '0';
|
const runOutput = '0';
|
||||||
vi.spyOn(System, 'run').mockResolvedValue(runOutput);
|
jest.spyOn(System, 'run').mockResolvedValue(runOutput);
|
||||||
await expect(Versioning.hasAnyVersionTags()).resolves.toStrictEqual(false);
|
await expect(Versioning.hasAnyVersionTags()).resolves.toStrictEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns true when the command returns >= 0', async () => {
|
it('returns true when the command returns >= 0', async () => {
|
||||||
const runOutput = '9';
|
const runOutput = '9';
|
||||||
vi.spyOn(System, 'run').mockResolvedValue(runOutput);
|
jest.spyOn(System, 'run').mockResolvedValue(runOutput);
|
||||||
await expect(Versioning.hasAnyVersionTags()).resolves.toStrictEqual(true);
|
await expect(Versioning.hasAnyVersionTags()).resolves.toStrictEqual(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getTotalNumberOfCommits', () => {
|
describe('getTotalNumberOfCommits', () => {
|
||||||
it('returns a number from the command', async () => {
|
it('returns a number from the command', async () => {
|
||||||
vi.spyOn(System, 'run').mockResolvedValue('9');
|
jest.spyOn(System, 'run').mockResolvedValue('9');
|
||||||
await expect(Versioning.getTotalNumberOfCommits()).resolves.toStrictEqual(9);
|
await expect(Versioning.getTotalNumberOfCommits()).resolves.toStrictEqual(9);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -71,9 +71,7 @@ export default class Versioning {
|
|||||||
static async determineBuildVersion(strategy: string, inputVersion: string): Promise<string> {
|
static async determineBuildVersion(strategy: string, inputVersion: string): Promise<string> {
|
||||||
// Validate input
|
// Validate input
|
||||||
if (!Object.hasOwnProperty.call(this.strategies, strategy)) {
|
if (!Object.hasOwnProperty.call(this.strategies, strategy)) {
|
||||||
throw new ValidationError(
|
throw new ValidationError(`Versioning strategy should be one of ${Object.values(this.strategies).join(', ')}.`);
|
||||||
`Versioning strategy should be one of ${Object.values(this.strategies).join(', ')}.`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (strategy) {
|
switch (strategy) {
|
||||||
@@ -124,9 +122,7 @@ export default class Versioning {
|
|||||||
|
|
||||||
// Ensure 3 digits (commits should always be patch level)
|
// Ensure 3 digits (commits should always be patch level)
|
||||||
const [major, minor, patch] = `${tag}.${commits}`.split('.');
|
const [major, minor, patch] = `${tag}.${commits}`.split('.');
|
||||||
const threeDigitVersion = /^\d+$/.test(patch)
|
const threeDigitVersion = /^\d+$/.test(patch) ? `${major}.${minor}.${patch}` : `${major}.0.${minor}`;
|
||||||
? `${major}.${minor}.${patch}`
|
|
||||||
: `${major}.0.${minor}`;
|
|
||||||
|
|
||||||
core.info(`Found semantic version ${threeDigitVersion} for ${this.branch}@${hash}`);
|
core.info(`Found semantic version ${threeDigitVersion} for ${this.branch}@${hash}`);
|
||||||
|
|
||||||
@@ -172,9 +168,7 @@ export default class Versioning {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
core.warning(
|
core.warning(`Failed to parse git describe output or version can not be determined through: "${description}".`);
|
||||||
`Failed to parse git describe output or version can not be determined through: "${description}".`,
|
|
||||||
);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -213,9 +207,7 @@ export default class Versioning {
|
|||||||
* identifies the current commit.
|
* identifies the current commit.
|
||||||
*/
|
*/
|
||||||
static async getVersionDescription() {
|
static async getVersionDescription() {
|
||||||
const versionTags = (
|
const versionTags = (await this.git(['tag', '--list', '--merged', 'HEAD', '--sort=-creatordate']))
|
||||||
await this.git(['tag', '--list', '--merged', 'HEAD', '--sort=-creatordate'])
|
|
||||||
)
|
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.filter((tag) => new RegExp(this.grepCompatibleInputVersionRegex).test(tag));
|
.filter((tag) => new RegExp(this.grepCompatibleInputVersionRegex).test(tag));
|
||||||
|
|
||||||
@@ -226,9 +218,7 @@ export default class Versioning {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const latestVersionTag = versionTags[0];
|
const latestVersionTag = versionTags[0];
|
||||||
const commitsCount = (
|
const commitsCount = (await this.git(['rev-list', `${latestVersionTag}..HEAD`, '--count'])).trim();
|
||||||
await this.git(['rev-list', `${latestVersionTag}..HEAD`, '--count'])
|
|
||||||
).trim();
|
|
||||||
const commitHash = (await this.git(['rev-parse', '--short', 'HEAD'])).trim();
|
const commitHash = (await this.git(['rev-parse', '--short', 'HEAD'])).trim();
|
||||||
|
|
||||||
return `${latestVersionTag}-${commitsCount}-g${commitHash}`;
|
return `${latestVersionTag}-${commitsCount}-g${commitHash}`;
|
||||||
@@ -263,9 +253,7 @@ export default class Versioning {
|
|||||||
*/
|
*/
|
||||||
static async hasAnyVersionTags() {
|
static async hasAnyVersionTags() {
|
||||||
const numberOfTagsAsString = await System.run('sh', undefined, {
|
const numberOfTagsAsString = await System.run('sh', undefined, {
|
||||||
input: Buffer.from(
|
input: Buffer.from(`git tag --list --merged HEAD | grep -E '${this.grepCompatibleInputVersionRegex}' | wc -l`),
|
||||||
`git tag --list --merged HEAD | grep -E '${this.grepCompatibleInputVersionRegex}' | wc -l`,
|
|
||||||
),
|
|
||||||
cwd: Input.projectPath,
|
cwd: Input.projectPath,
|
||||||
silent: false,
|
silent: false,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
import { afterEach, beforeEach } from 'vitest';
|
|
||||||
|
|
||||||
// Fail tests when console.error / console.warn etc are called from
|
|
||||||
// production code under test. Mirrors the jest-fail-on-console behaviour
|
|
||||||
// the previous jest setup enforced. Tests can opt-out by replacing the
|
|
||||||
// method with vi.spyOn(console, 'error') for the duration of that test.
|
|
||||||
const original = {
|
|
||||||
log: console.log,
|
|
||||||
warn: console.warn,
|
|
||||||
error: console.error,
|
|
||||||
assert: console.assert,
|
|
||||||
};
|
|
||||||
|
|
||||||
const fail = (level: 'log' | 'warn' | 'error' | 'assert', args: unknown[]) => {
|
|
||||||
throw new Error(
|
|
||||||
`console.${level} was called with: ${args.map(String).join(' ')}\n` +
|
|
||||||
`Tests must use vi.spyOn(console, '${level}') if console output is expected.`,
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
console.log = (...args: unknown[]) => fail('log', args);
|
|
||||||
console.warn = (...args: unknown[]) => fail('warn', args);
|
|
||||||
console.error = (...args: unknown[]) => fail('error', args);
|
|
||||||
console.assert = ((...args: unknown[]) => fail('assert', args)) as typeof console.assert;
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
Object.assign(console, original);
|
|
||||||
});
|
|
||||||
14
src/types/game-ci-orchestrator.d.ts
vendored
14
src/types/game-ci-orchestrator.d.ts
vendored
@@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Type declarations for @game-ci/orchestrator.
|
* Type declarations for @game-ci/orchestrator.
|
||||||
*
|
*
|
||||||
* This optional dependency is one implementation of unity-builder's generic
|
* This optional dependency provides remote build orchestration and plugin
|
||||||
* plugin lifecycle. When installed, the plugin loader in plugin.ts
|
* services. When installed, the plugin loader in orchestrator-plugin.ts
|
||||||
* dynamically imports it.
|
* dynamically imports it.
|
||||||
*/
|
*/
|
||||||
declare module '@game-ci/orchestrator' {
|
declare module '@game-ci/orchestrator' {
|
||||||
interface Plugin {
|
interface OrchestratorPlugin {
|
||||||
initialize(coreParams: Record<string, any>, workspace: string): Promise<void>;
|
initialize(coreParams: Record<string, any>, workspace: string): Promise<void>;
|
||||||
canHandleBuild(): boolean;
|
canHandleBuild(): boolean;
|
||||||
handleBuild(baseImage: string): Promise<{ exitCode: number; fallbackToLocal?: boolean }>;
|
handleBuild(baseImage: string): Promise<{ exitCode: number; fallbackToLocal?: boolean }>;
|
||||||
@@ -16,11 +16,11 @@ declare module '@game-ci/orchestrator' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a unity-builder plugin instance.
|
* Create an orchestrator plugin instance.
|
||||||
* The plugin reads its own configuration from environment variables and
|
* The plugin reads its own configuration from environment variables
|
||||||
* GitHub Actions inputs; unity-builder does not need to proxy them.
|
* and GitHub Actions inputs — unity-builder does not need to proxy them.
|
||||||
*/
|
*/
|
||||||
export function createPlugin(): Plugin;
|
export function createPlugin(): OrchestratorPlugin;
|
||||||
|
|
||||||
// Legacy export — kept for backward compatibility with CLI and direct consumers
|
// Legacy export — kept for backward compatibility with CLI and direct consumers
|
||||||
export const Orchestrator: {
|
export const Orchestrator: {
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"target": "ES2022",
|
"target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
|
||||||
"lib": ["ES2022", "DOM"],
|
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
||||||
"module": "commonjs",
|
"outDir": "./lib" /* Redirect output structure to the directory. */,
|
||||||
"moduleResolution": "node",
|
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
|
||||||
"outDir": "./lib",
|
"strict": true /* Enable all strict type-checking options. */,
|
||||||
"rootDir": "./src",
|
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
|
||||||
"strict": true,
|
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||||
"noImplicitAny": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"types": ["node"]
|
|
||||||
},
|
},
|
||||||
"include": ["src/**/*", "types/**/*"],
|
"include": ["src/**/*", "types/**/*"],
|
||||||
"exclude": ["node_modules", "dist", "lib"]
|
"exclude": ["node_modules", "dist"]
|
||||||
}
|
}
|
||||||
|
|||||||
1
types/shell-quote.d.ts
vendored
1
types/shell-quote.d.ts
vendored
@@ -13,3 +13,4 @@ declare module 'shell-quote' {
|
|||||||
*/
|
*/
|
||||||
export function parse(cmd: string): string[];
|
export function parse(cmd: string): string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
import { defineConfig } from 'vitest/config';
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
test: {
|
|
||||||
environment: 'node',
|
|
||||||
globals: true,
|
|
||||||
setupFiles: ['./src/test/setup.ts'],
|
|
||||||
include: ['src/**/*.test.ts'],
|
|
||||||
coverage: {
|
|
||||||
provider: 'istanbul',
|
|
||||||
reporter: ['text', 'html', 'lcov'],
|
|
||||||
include: ['src/**/*.ts'],
|
|
||||||
exclude: ['src/**/*.test.ts', 'src/index.ts'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user