Created
February 4, 2021 10:29
-
-
Save marpe/db2c711edfd70f718dd9aaedae9598cc to your computer and use it in GitHub Desktop.
gameci workflow file for unity testing with coverage and building
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Actions 😎 | |
on: | |
push: | |
branches: | |
- master | |
env: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
# Cache | |
- uses: actions/cache@v2 | |
with: | |
path: TW.Unity/Library | |
key: TW.Unity-Library | |
# Test | |
- name: Run tests | |
uses: webbertakken/[email protected] | |
with: | |
unityVersion: 2020.2.2f1 | |
projectPath: TW.Unity | |
customParameters: -enableCodeCoverage -coverageResultsPath /github/workspace/artifacts/coverage -coverageHistoryPath /github/workspace/artifacts/coverage-history -coverageOptions generateHtmlReport;generateHtmlReportHistory;generateBadgeReport;generateAdditionalMetrics;assemblyFilters:+UTW.*;pathFilters:-*/Tests/*,-*/BuiltInPackages/* -debugCodeOptimization | |
# Publish test results | |
- name: Publish test results | |
uses: rainbow-duck-games/[email protected] | |
if: always() | |
with: | |
reportPaths: artifacts/*.xml | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
workdirPrefix: /github/workspace/TW.Unity | |
# Upload test results | |
- uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: Test results | |
path: artifacts | |
build: | |
needs: test | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
# Cache | |
- uses: actions/cache@v2 | |
with: | |
path: TW.Unity/Library | |
key: TW.Unity-Library | |
# Build | |
- name: Build project | |
uses: webbertakken/[email protected] | |
with: | |
unityVersion: 2020.2.2f1 | |
targetPlatform: Android | |
versioning: Semantic | |
projectPath: TW.Unity | |
allowDirtyBuild: true | |
# Output | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: Build | |
path: build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment