Skip to content

Commit

Permalink
feat(workflows): add ci and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Dec 30, 2024
1 parent 86a44f7 commit 13cbe1f
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
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

0 comments on commit 13cbe1f

Please sign in to comment.