2020-03-01 15:02:27 +00:00
|
|
|
name: CI
|
|
|
|
#on:
|
|
|
|
# pull_request: {}
|
|
|
|
# push: { branches: [master] }
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- 'doc/**'
|
|
|
|
- '*.md'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
requestActivationFile:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: false
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Request manual activation file
|
2020-04-03 02:28:31 +00:00
|
|
|
uses: MirrorNG/unity-runner@2.0.0
|
2020-03-01 15:02:27 +00:00
|
|
|
id: getManualLicenseFile
|
|
|
|
with:
|
|
|
|
entrypoint: /request_activation.sh
|
|
|
|
|
|
|
|
- name: Expose as artifact
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: Manual Activation File
|
|
|
|
path: ${{ steps.getManualLicenseFile.outputs.filePath }}
|
|
|
|
|
2020-04-12 01:46:44 +00:00
|
|
|
CI:
|
|
|
|
name: Test
|
2020-03-01 15:02:27 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
|
|
if: true
|
|
|
|
steps:
|
|
|
|
|
|
|
|
# Checkout repository (required to test local actions)
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-04-12 01:46:44 +00:00
|
|
|
|
2020-03-01 16:25:13 +00:00
|
|
|
- name: Add Coverage Plugin
|
|
|
|
uses: canastro/copy-action@0.0.2
|
|
|
|
with:
|
|
|
|
source: Packages/manifest-coverage.json
|
|
|
|
target: Packages/manifest.json
|
|
|
|
|
2020-03-01 15:02:27 +00:00
|
|
|
- name: Activate license
|
2020-04-03 02:28:31 +00:00
|
|
|
uses: MirrorNG/unity-runner@2.0.0
|
2020-03-01 15:02:27 +00:00
|
|
|
with:
|
|
|
|
entrypoint: /activate.sh
|
|
|
|
|
|
|
|
- name: Generate Solution
|
2020-04-03 02:28:31 +00:00
|
|
|
uses: MirrorNG/unity-runner@2.0.0
|
2020-03-01 15:02:27 +00:00
|
|
|
with:
|
|
|
|
# Arguments to pass to unity
|
|
|
|
args: -buildTarget StandaloneWindows64 -customBuildName MirrorNG -customBuildPath ./build/StandaloneWindows64 -projectPath . -executeMethod UnityEditor.SyncVS.SyncSolution -quit
|
|
|
|
|
|
|
|
# Configure test runner
|
|
|
|
- name: Run editor Tests
|
2020-04-03 02:28:31 +00:00
|
|
|
uses: MirrorNG/unity-runner@2.0.0
|
2020-03-01 15:02:27 +00:00
|
|
|
with:
|
|
|
|
args: -runTests -testPlatform editmode -testResults Tests/editmode-results.xml -enableCodeCoverage -coverageResultsPath Tests
|
|
|
|
|
|
|
|
- name: Run play Tests
|
2020-04-03 02:28:31 +00:00
|
|
|
uses: MirrorNG/unity-runner@2.0.0
|
2020-03-01 15:02:27 +00:00
|
|
|
with:
|
|
|
|
args: -runTests -testPlatform playmode -testResults Tests/playmode-results.xml -enableCodeCoverage -coverageResultsPath Tests
|
|
|
|
|
|
|
|
# Upload artifacts
|
2020-04-06 13:25:07 +00:00
|
|
|
- name: Archive test results
|
2020-03-01 15:02:27 +00:00
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: Test results (editor mode)
|
|
|
|
path: Tests
|
2020-04-06 13:25:07 +00:00
|
|
|
|
|
|
|
- name: Publish test results
|
2020-04-21 01:50:56 +00:00
|
|
|
uses: MirrorNG/nunit-reporter@v1.0.9
|
2020-04-06 13:25:07 +00:00
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
path: "Tests/*.xml"
|
|
|
|
access-token: ${{ secrets.GITHUB_TOKEN }}
|
2020-03-01 15:02:27 +00:00
|
|
|
|
|
|
|
- name: SonarQube analysis
|
|
|
|
if: always()
|
2020-04-03 02:28:31 +00:00
|
|
|
uses: MirrorNG/unity-runner@2.0.0
|
2020-03-01 15:02:27 +00:00
|
|
|
with:
|
2020-04-03 02:28:31 +00:00
|
|
|
entrypoint: /sonar-scanner.sh
|
2020-03-01 15:02:27 +00:00
|
|
|
projectKey: vis2k_Mirror
|
|
|
|
projectName: Mirror
|
|
|
|
sonarOrganisation: vis2k
|
2020-08-04 21:55:14 +00:00
|
|
|
beginArguments: >-
|
|
|
|
/d:sonar.verbose="true"
|
|
|
|
/d:sonar.cs.nunit.reportsPaths=Tests/editmode-results.xml,Tests/playimode-results.xml
|
|
|
|
/d:sonar.cs.opencover.reportsPaths=Tests/workspace-opencov/EditMode/TestCoverageResults_0000.xml,Tests/workspace-opencov/PlayMode/TestCoverageResults_0000.xml
|
2020-11-01 17:19:01 +00:00
|
|
|
/d:sonar.coverage.exclusions=Assets/Mirror/Runtime/Transport/Telepathy/**/*.cs,Assets/Mirror/Runtime/Transport/SimpleWebTransport/**,Assets/Mirror/Runtime/Transport/KCP/kcp2k/**,Assets/Mirror/Cloud/**/*.cs,Assets/Mirror/Examples/**/*.cs,Assets/Mirror/Tests/**/*.cs
|
2020-10-16 15:46:45 +00:00
|
|
|
/d:sonar.exclusions=Assets/Mirror/Runtime/Transport/SimpleWebTransport/**
|
2020-08-04 21:55:14 +00:00
|
|
|
# files ignored in code coverage:
|
2020-10-16 15:46:45 +00:00
|
|
|
# Assets/Mirror/Runtime/Transport/Telepathy/** - has its own test in the Telepathy repo
|
|
|
|
# Assets/Mirror/Runtime/Transport/SimpleWebTransport/** - fully exclude this because it has sonar running on its repo
|
2020-11-01 17:19:01 +00:00
|
|
|
# Assets/Mirror/Runtime/Transport/KCP/kcp2k/** - has its own test in the kcp2k repo
|
2020-08-04 21:55:14 +00:00
|
|
|
# Assets/Mirror/Cloud/** - has its own tests in private cloud repo
|
|
|
|
# Assets/Mirror/Examples/** - examples dont need test coverage
|
2020-08-09 19:59:33 +00:00
|
|
|
# Assets/Mirror/Tests/** - tests dont need test coverage
|
2020-03-01 15:02:27 +00:00
|
|
|
env:
|
|
|
|
FrameworkPathOverride: /opt/Unity/Editor/Data/MonoBleedingEdge/
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-04-12 01:46:44 +00:00
|
|
|
|
|
|
|
Release:
|
|
|
|
runs-on: windows-latest
|
|
|
|
needs: CI
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Delete Tests
|
|
|
|
run: |
|
|
|
|
Remove-Item -Recurse -Force Assets\Mirror\Tests
|
|
|
|
Remove-Item -Recurse -Force Assets\Mirror\Tests.meta
|
|
|
|
|
|
|
|
- name: Setup dotnet
|
|
|
|
uses: actions/setup-dotnet@v1
|
|
|
|
with:
|
|
|
|
dotnet-version: '3.1.100'
|
|
|
|
|
|
|
|
- name: Install unity-packer
|
|
|
|
run: dotnet tool install -g unity-packer
|
|
|
|
|
|
|
|
- name: Package
|
|
|
|
run: |
|
2021-02-05 01:34:22 +00:00
|
|
|
unity-packer pack Mirror.unitypackage Assets/Mirror Assets/Mirror Assets/ScriptTemplates Assets/ScriptTemplates LICENSE Assets/Mirror/LICENSE
|
2020-04-12 01:46:44 +00:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: Mirror.unitypackage
|
|
|
|
path: Mirror.unitypackage
|
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: cycjimmy/semantic-release-action@v2
|
|
|
|
with:
|
|
|
|
extra_plugins: |
|
|
|
|
@semantic-release/exec
|
|
|
|
@semantic-release/changelog
|
|
|
|
@semantic-release/git
|
|
|
|
branch: master
|
|
|
|
env:
|
2020-04-21 01:50:56 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|