Skip to content

Commit f1bd0e1

Browse files
add validation workflows
1 parent dd3f2ea commit f1bd0e1

File tree

3 files changed

+157
-0
lines changed

3 files changed

+157
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"os": [
3+
"ubuntu-latest",
4+
"windows-latest",
5+
"macos-latest"
6+
],
7+
"unity-version": [
8+
"2019",
9+
"2020",
10+
"2022",
11+
"6000.0",
12+
"6000.1",
13+
"6000.2"
14+
],
15+
"include": [
16+
{
17+
"os": "ubuntu-latest",
18+
"build-target": "StandaloneLinux64"
19+
},
20+
{
21+
"os": "ubuntu-latest",
22+
"build-target": "WebGL",
23+
"build-args": "-colorSpace Gamma"
24+
},
25+
{
26+
"os": "ubuntu-latest",
27+
"build-target": "Android"
28+
},
29+
{
30+
"os": "windows-latest",
31+
"build-target": "StandaloneWindows64"
32+
},
33+
{
34+
"os": "windows-latest",
35+
"build-target": "Android"
36+
},
37+
{
38+
"os": "macos-latest",
39+
"build-target": "StandaloneOSX"
40+
},
41+
{
42+
"os": "macos-latest",
43+
"build-target": "iOS"
44+
}
45+
]
46+
}

.github/workflows/build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: build
2+
permissions:
3+
contents: read
4+
on:
5+
workflow_call:
6+
inputs:
7+
matrix:
8+
required: true
9+
type: string
10+
secrets:
11+
UNITY_USERNAME:
12+
required: true
13+
UNITY_PASSWORD:
14+
required: true
15+
jobs:
16+
build:
17+
name: ${{ matrix.name }}
18+
strategy:
19+
matrix: ${{ fromJSON(inputs.matrix) }}
20+
fail-fast: false
21+
runs-on: ${{ matrix.os }}
22+
permissions:
23+
contents: read
24+
steps:
25+
- uses: actions/checkout@v5
26+
- uses: RageAgainstThePixel/unity-setup@v2
27+
with:
28+
version-file: None
29+
build-targets: ${{ matrix.build-target }}
30+
unity-version: ${{ matrix.unity-version }}
31+
- uses: RageAgainstThePixel/activate-unity-license@v2
32+
with:
33+
license: Personal
34+
username: ${{ secrets.UNITY_USERNAME }}
35+
password: ${{ secrets.UNITY_PASSWORD }}
36+
- uses: ./ #RageAgainstThePixel/create-unity-project
37+
id: unity-project
38+
with:
39+
project-name: Test Project
40+
- name: Add Build Pipeline Package
41+
run: |
42+
npm install -g openupm-cli
43+
openupm add com.utilities.buildpipeline
44+
working-directory: ${{ steps.unity-project.outputs.project-path }}
45+
shell: bash
46+
- uses: RageAgainstThePixel/unity-action@v2
47+
name: ${{ matrix.build-target }}-Validate
48+
with:
49+
build-target: ${{ matrix.build-target }}
50+
project-path: ${{ steps.unity-project.outputs.project-path }}
51+
log-name: ${{ matrix.build-target }}-Validate
52+
args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset
53+
- uses: RageAgainstThePixel/unity-action@v2
54+
name: ${{ matrix.build-target }}-Build
55+
with:
56+
build-target: ${{ matrix.build-target }}
57+
project-path: ${{ steps.unity-project.outputs.project-path }}
58+
log-name: ${{ matrix.build-target }}-Build
59+
args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity ${{ matrix.build-args }}
60+
- uses: actions/upload-artifact@v4
61+
name: Upload Artifacts
62+
if: always()
63+
with:
64+
name: ${{ github.run_number }}.${{ github.run_attempt }} ${{ matrix.os }} ${{ matrix.unity-version }} ${{ matrix.build-target }} Artifacts
65+
path: |
66+
${{ github.workspace }}/**/*.log
67+
${{ github.workspace }}/**/Builds/${{ matrix.build-target }}/

.github/workflows/validate.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: validate
2+
on:
3+
schedule:
4+
- cron: '0 0 * * 0' # Every Sunday at midnight
5+
push:
6+
branches: ['main']
7+
pull_request:
8+
branches: ['*']
9+
types: [opened, synchronize, reopened, ready_for_review]
10+
workflow_dispatch:
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
jobs:
15+
setup:
16+
if: github.event.pull_request.draft == false
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
steps:
21+
- uses: actions/checkout@v5
22+
with:
23+
sparse-checkout: .github/
24+
- uses: RageAgainstThePixel/job-builder@v1
25+
id: setup-jobs
26+
with:
27+
build-options: ./.github/workflows/build-options.json
28+
group-by: 'unity-version'
29+
outputs:
30+
jobs: ${{ steps.setup-jobs.outputs.jobs }}
31+
validate:
32+
if: ${{ needs.setup.outputs.jobs }}
33+
needs: setup
34+
name: build ${{ matrix.jobs.name }}
35+
permissions:
36+
contents: read
37+
strategy:
38+
matrix: ${{ fromJSON(needs.setup.outputs.jobs) }}
39+
fail-fast: false
40+
max-parallel: 1
41+
secrets: inherit
42+
uses: ./.github/workflows/build.yml
43+
with:
44+
matrix: ${{ toJSON(matrix.jobs.matrix) }}

0 commit comments

Comments
 (0)