-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(workflows): add ci and release workflows
- Loading branch information
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# Git LFS | ||
- name: Create LFS file list | ||
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id | ||
|
||
- name: Restore LFS cache | ||
uses: actions/cache@v3 | ||
id: lfs-cache | ||
with: | ||
path: .git/lfs | ||
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} | ||
|
||
- name: Git LFS Pull | ||
run: | | ||
git lfs pull | ||
git add . | ||
git reset --hard | ||
# Cache | ||
- uses: actions/cache@v3 | ||
with: | ||
path: Library | ||
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} | ||
restore-keys: | | ||
Library- | ||
- name: Run Unity Tests | ||
uses: game-ci/unity-test-runner@v4 | ||
env: | ||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | ||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | ||
with: | ||
projectPath: . | ||
testMode: all | ||
artifactsPath: TestResults | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload Test Results | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: Test Results | ||
path: TestResults | ||
|
||
format: | ||
name: Check Code Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '6.0.x' | ||
|
||
- name: Install dotnet-format | ||
run: dotnet tool install -g dotnet-format | ||
|
||
- name: Check C# Formatting | ||
run: dotnet format --verify-no-changes |