Skip to content

Commit

Permalink
Add free disk space action and fix #361 (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmfinol authored Jul 15, 2023
1 parent cafd99e commit 1f4c74e
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 26 deletions.
36 changes: 19 additions & 17 deletions docs/03-github/01-getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ jobs:
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
lfs: true

# Cache
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
Expand All @@ -107,7 +107,7 @@ jobs:
targetPlatform: WebGL

# Output
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: Build
path: build
Expand All @@ -131,14 +131,14 @@ jobs:
steps:
# Checkout (without LFS)
- name: Checkout repository
uses: actions/checkout@v2
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@v2
uses: actions/cache@v3
id: lfs-cache
with:
path: .git/lfs
Expand All @@ -151,7 +151,7 @@ jobs:
git reset --hard
# Cache
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
Expand All @@ -177,7 +177,7 @@ jobs:
targetPlatform: WebGL

# Output
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: Build
path: build
Expand Down Expand Up @@ -219,11 +219,11 @@ jobs:
- Android # Build an Android player.
- WebGL # WebGL.
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ matrix.projectPath }}/Library
key:
Expand All @@ -241,11 +241,13 @@ jobs:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: always()
with:
name: Test results (all modes)
path: ${{ steps.testRunner.outputs.artifactsPath }}
- if: matrix.targetPlatform == 'Android'
uses: jlumbroso/free-disk-space@v1.2.0
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
Expand All @@ -256,7 +258,7 @@ jobs:
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
customParameters: '-myParameter myValue -myBoolean -ThirdParameter andItsValue'
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: Build
path: build
Expand All @@ -279,11 +281,11 @@ jobs:
- WSAPlayer # Build a UWP App.

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ matrix.projectPath }}/Library
key:
Expand All @@ -303,7 +305,7 @@ jobs:
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
customParameters: '-myParameter myValue -myBoolean -ThirdParameter andItsValue'
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: Build
path: build
Expand All @@ -323,12 +325,12 @@ jobs:
- StandaloneOSX # Build a macOS standalone.

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ matrix.projectPath }}/Library
key:
Expand All @@ -350,7 +352,7 @@ jobs:
targetPlatform: ${{ matrix.targetPlatform }}
customParameters: '-myParameter myValue -myBoolean -ThirdParameter andItsValue'

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: Build
path: build
Expand Down
8 changes: 5 additions & 3 deletions docs/03-github/04-builder.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -554,21 +554,23 @@ jobs:
- Android # Build an Android .apk standalone app.
- WebGL # WebGL.
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- if: matrix.targetPlatform == 'Android'
uses: jlumbroso/free-disk-space@v1.2.0
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
Expand Down
9 changes: 5 additions & 4 deletions docs/03-github/06-deployment/android.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ jobs:
name: Build For Android Platform
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: jlumbroso/free-disk-space@v1.2.0
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: Library
key: Library-Android
Expand All @@ -181,7 +182,7 @@ jobs:
androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }}
androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }}
androidTargetSdkVersion: AndroidApiLevel31
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: build-Android
path: build/Android
Expand All @@ -198,7 +199,7 @@ jobs:
ANDROID_PACKAGE_NAME: ${{ secrets.ANDROID_PACKAGE_NAME }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Download Android Artifact
uses: actions/download-artifact@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions docs/05-gitlab/02-activation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ there should be a manual step that can be triggered for activation.

All you need is [docker](https://www.docker.com/) installed on your machine.

1. Clone this project
1. Clone [this project](https://gitlab.com/game-ci/unity3d-gitlab-ci-example)
2. Pull the docker image and run bash inside, passing Unity username and password to env

_hint: you should write this to a shell script and execute the shell script so you don't have
Expand Down Expand Up @@ -115,7 +115,7 @@ All you need is [docker](https://www.docker.com/) installed on your machine.

## Unity Plus/Pro

1. Clone this project
1. Clone [this project](https://gitlab.com/game-ci/unity3d-gitlab-ci-example)
2. Pull the docker image and run bash inside, passing Unity username and password to env

_hint: you should write this to a shell script and execute the shell script so you don't have
Expand Down
19 changes: 19 additions & 0 deletions docs/09-troubleshooting/common-issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,25 @@ engine and CI/CD:
- Try to search for error keywords in your message such as `error`, `failed`, `exception`, etc.
- Read the error message closely to understand what's going on.

### No space left on device

#### Error

```plaintext
docker: failed to register layer: ApplyLayer exit status 1 stdout: stderr: write /opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.8/lib/linux/x86_64/libFuzzer.a: no space left on device.
```

#### Solution

The GitHub-hosted runners often do not have enough disk space for game dev projects. To work around
this limitation, you could try to use the
[Free Disk Space (Ubuntu)](https://github.com/marketplace/actions/free-disk-space-ubuntu) action at
the start of your workflow. If you still require additional disk space for your project, you could
try using
[Self-hosted Runners](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners)
or using
[Cloud Runners](https://game.ci/docs/github-cloud-runner/game-ci-vs-cloud-runner#large-github-projects).

## Still having problems?

You can **search for existing issues**:
Expand Down

0 comments on commit 1f4c74e

Please sign in to comment.