Skip to content

build: update release workflows #223

build: update release workflows

build: update release workflows #223

Workflow file for this run

# Required secrets
# UNITY_LICENSE: The contents of Unity license file
name: 🧪 Test
env:
# MINIMUM_VERSION: The minimum version of Unity.
MINIMUM_VERSION: 2020.1
EXCLUDE_FILTER: '(2020.2.0)'
on:
workflow_dispatch:
inputs:
latestPatchOnly:
description: "Test only latest patch version (fast-mode)"
required: false
default: false
type: boolean
push:
branches:
- develop
tags:
- "!*"
paths-ignore:
- "*.md"
pull_request:
types:
- opened
- synchronize
jobs:
setup:
name: ⚙️ Setup
runs-on: ubuntu-latest
outputs:
unityVersions: ${{ steps.setup.outputs.unityVersions }}
steps:
- name: ⚙️ Find target Unity versions
id: setup
run: |
echo "==== Target Unity Versions ===="
LATEST_VERSIONS=`npx unity-changeset list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all`
if [ "${{ inputs.latestPatchOnly }}" == "true" ]; then
ADDITIONAL_VERSIONS="[]"
else
ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json`
fi
VERSIONS=`echo "[${LATEST_VERSIONS}, ${ADDITIONAL_VERSIONS}]" \
| jq -c '[ flatten | sort | unique | .[] | select( test("${{ env.EXCLUDE_FILTER }}") | not ) ]'`
echo "unityVersions=${VERSIONS}" | tee $GITHUB_OUTPUT
test:
name: 🧪 Run tests
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
needs: setup
strategy:
fail-fast: false
matrix:
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
steps:
- name: 🚚 Checkout
uses: actions/checkout@v4
- name: 📥 Cache library
uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.unityVersion }}-${{ github.sha }}
restore-keys: |
Library-${{ matrix.unityVersion }}-
Library-
- name: 🧪 Run tests
uses: game-ci/unity-test-runner@v4
timeout-minutes: 30
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
customImage: mobsakai/unity3d:${{ matrix.unityVersion }}
# unityVersion: ${{ matrix.unityVersion }}
customParameters: -nographics
checkName: ${{ matrix.unityVersion }} Test Results
githubToken: ${{ github.token }}
coverageOptions: "dontClear;generateHtmlReport;generateBadgeReport;pathFilters:+**/Packages/src/**;assemblyFilters:+<packages>,-*.Editor,-*.Test"