Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually cache git LFS #7

Merged
merged 7 commits into from
May 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 67 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,53 @@ jobs:
- EditMode
- PlayMode
steps:
- uses: actions/checkout@v2

# This destroys 2GB free quota within a day
# - uses: actions/checkout@v2
# with:
# lfs: true

# Workaround: https://github.com/actions/checkout/issues/165#issuecomment-657673315
- name: Checkout code
uses: actions/checkout@v2

- 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@v2
id: lfs-cache
with:
lfs: true
- uses: actions/cache@v2
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

- name: Git LFS Pull
run: |
git lfs pull
git add .
git reset --hard

- name: Restore Library cache
uses: actions/cache@v2
id: lib-cache
with:
path: Library
key: Library-Test
restore-keys: |
Library-
- uses: game-ci/[email protected]

- name: Test run
uses: game-ci/[email protected]
id: testRunner
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
testMode: ${{ matrix.testMode }}
checkName: ${{ matrix.testMode }} test results
githubToken: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v2

- name: Upload test artifacts
uses: actions/upload-artifact@v2
with:
name: Test results (${{ matrix.testMode }})
path: ${{ steps.testRunner.outputs.artifactsPath }}
Expand All @@ -55,22 +84,50 @@ jobs:
- StandaloneWindows64
- StandaloneLinux64
steps:
- uses: actions/checkout@v2
# This destroys 2GB free quota within a day
# - uses: actions/checkout@v2
# with:
# lfs: true

# Workaround: https://github.com/actions/checkout/issues/165#issuecomment-657673315
- name: Checkout code
uses: actions/checkout@v2

- 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@v2
id: lfs-cache
with:
lfs: true
- uses: actions/cache@v2
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}

- name: Git LFS Pull
run: |
git lfs pull
git add .
git reset --hard

- name: Restore Library cache
uses: actions/cache@v2
id: lib-cache
with:
path: Library
key: Library-Build-${{ matrix.targetPlatform }}
restore-keys: |
Library-Build-
Library-
- uses: game-ci/unity-builder@38695bb26e1c15f43419ed9ab30c4bb7f92db311

- name: Build project
uses: game-ci/unity-builder@38695bb26e1c15f43419ed9ab30c4bb7f92db311
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
- uses: actions/upload-artifact@v2

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: Build (${{ matrix.targetPlatform }})
path: build/${{ matrix.targetPlatform }}