2021-01-06 15:59:14 +08:00
|
|
|
# Secrets
|
|
|
|
# UNITY_LICENSE:
|
|
|
|
name: test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
|
|
|
tags:
|
|
|
|
- "!*"
|
|
|
|
pull_request:
|
|
|
|
types:
|
|
|
|
- opened
|
|
|
|
- synchronize
|
|
|
|
|
|
|
|
jobs:
|
2022-06-17 08:14:30 +08:00
|
|
|
setup:
|
2021-01-06 15:59:14 +08:00
|
|
|
runs-on: ubuntu-latest
|
2022-06-17 08:14:30 +08:00
|
|
|
outputs:
|
|
|
|
versions: ${{ steps.setup.outputs.versions }}
|
|
|
|
steps:
|
|
|
|
- id: setup
|
|
|
|
run: |
|
|
|
|
VERSIONS=`npx unity-changeset list --versions --all --latest-patch --min 2018.3 --json`
|
|
|
|
echo "==== Target Unity Versions ===="
|
|
|
|
echo "${VERSIONS}"
|
|
|
|
echo "::set-output name=versions::${VERSIONS}"
|
|
|
|
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: setup
|
2021-01-06 15:59:14 +08:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-06-17 08:14:30 +08:00
|
|
|
version: ${{ fromJson(needs.setup.outputs.versions) }}
|
2021-01-06 15:59:14 +08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
# Checkout sandbox project
|
2023-08-18 16:52:48 +08:00
|
|
|
- uses: actions/checkout@v3
|
2021-01-06 15:59:14 +08:00
|
|
|
with:
|
|
|
|
ref: sandbox
|
|
|
|
submodules: true
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
# Update package submodule
|
|
|
|
- name: "Update package submodule"
|
|
|
|
working-directory: Packages/dev
|
|
|
|
run: git checkout ${{ github.sha }}
|
|
|
|
|
2022-06-17 08:14:30 +08:00
|
|
|
# Cache
|
2023-08-18 16:52:48 +08:00
|
|
|
- uses: actions/cache@v3
|
2021-01-06 15:59:14 +08:00
|
|
|
with:
|
|
|
|
path: Library
|
2022-06-17 08:14:30 +08:00
|
|
|
key: Library-${{ matrix.version }}-${{ github.sha }}
|
2021-01-06 15:59:14 +08:00
|
|
|
restore-keys: |
|
2022-06-17 08:14:30 +08:00
|
|
|
Library-${{ matrix.version }}-
|
2021-01-06 15:59:14 +08:00
|
|
|
Library-
|
|
|
|
|
|
|
|
# Run tests
|
|
|
|
- name: "Run tests"
|
2022-06-17 08:14:30 +08:00
|
|
|
uses: game-ci/unity-test-runner@v2
|
2021-01-06 15:59:14 +08:00
|
|
|
with:
|
2022-06-17 08:14:30 +08:00
|
|
|
customImage: mobsakai/unity3d:${{ matrix.version }}
|
|
|
|
customParameters: -nographics
|
|
|
|
# unityVersion: ${{ matrix.version }}
|
|
|
|
checkName: ${{ matrix.version }} Test Results
|
|
|
|
githubToken: ${{ github.token }}
|
2021-02-19 11:58:51 +08:00
|
|
|
env:
|
|
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|