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

Add test on Nuget package #4261

Merged
merged 49 commits into from
Apr 6, 2025
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
fe07bc1
Add test on Nuget package
Chernobrovkin-AD Mar 14, 2025
0f3a59b
Add test on Nuget package
Chernobrovkin-AD Mar 14, 2025
8bce1df
Add test on Nuget package
Chernobrovkin-AD Mar 17, 2025
159b7e2
Add test on Nuget package
Chernobrovkin-AD Mar 17, 2025
26de21a
Add test on Nuget package
Chernobrovkin-AD Mar 17, 2025
bc9fe8f
Add samples on signed distance
Chernobrovkin-AD Mar 17, 2025
a3b5aec
Add samples on signed distance
Chernobrovkin-AD Mar 17, 2025
38450af
upd workflow runner labels
MaxRayskiy Mar 18, 2025
db946ba
fix s3 cp for unity test
MaxRayskiy Mar 20, 2025
e3927d7
Merge branch 'master' into add-unity-test
MaxRayskiy Mar 20, 2025
4f2bde9
test run
MaxRayskiy Mar 20, 2025
d428799
always upload test results
MaxRayskiy Mar 20, 2025
cc9fd2b
do not fail on rm
MaxRayskiy Mar 20, 2025
73fa6de
test new file name
MaxRayskiy Mar 20, 2025
d7f7dc5
Add samples on signed distances
Chernobrovkin-AD Mar 21, 2025
7ae26ed
Fix for Unity path
Chernobrovkin-AD Mar 21, 2025
d0f5e26
Fix for Unity path
Chernobrovkin-AD Mar 21, 2025
86a1095
Fix for Unity path
Chernobrovkin-AD Mar 21, 2025
869bc22
Fix for Unity path
Chernobrovkin-AD Mar 21, 2025
42103de
Fix for Unity path
Chernobrovkin-AD Mar 21, 2025
89b5895
Fix for Unity path
Chernobrovkin-AD Mar 21, 2025
7e20022
Fix for Unity path
Chernobrovkin-AD Mar 21, 2025
a32d959
Fix for Unity path
Chernobrovkin-AD Mar 21, 2025
029c31b
Fix for Unity path
Chernobrovkin-AD Mar 21, 2025
079e2cd
Fix for Unity path
Chernobrovkin-AD Mar 24, 2025
25d0366
Fix for Unity path
Chernobrovkin-AD Mar 24, 2025
d15f2a3
Fix for Unity path
Chernobrovkin-AD Mar 24, 2025
20336ab
Add patch for nuget package
Chernobrovkin-AD Mar 27, 2025
7278cce
Add patch for nuget package
Chernobrovkin-AD Mar 27, 2025
62952bd
Add patch for nuget package
Chernobrovkin-AD Mar 27, 2025
1f81d9f
Add patch for nuget package
Chernobrovkin-AD Mar 27, 2025
cef4075
Add patch for nuget package
Chernobrovkin-AD Mar 27, 2025
152f3ce
Add patch for nuget package
Chernobrovkin-AD Mar 28, 2025
f8fd9a0
Add patch for nuget package
Chernobrovkin-AD Mar 28, 2025
87a4671
Add patch for nuget package
Chernobrovkin-AD Mar 28, 2025
1cc5114
Add unity test
Chernobrovkin-AD Mar 31, 2025
2bc919a
Add unity test
Chernobrovkin-AD Mar 31, 2025
6963821
Add unity test
Chernobrovkin-AD Apr 1, 2025
b7e36c3
Add test and sample on variable offset
Chernobrovkin-AD Apr 3, 2025
7a257eb
Add test and sample on variable offset
Chernobrovkin-AD Apr 3, 2025
78203da
Add test and sample on variable offset
Chernobrovkin-AD Apr 4, 2025
48e39c8
Add test and sample on variable offset
Chernobrovkin-AD Apr 4, 2025
e8b7e30
Merge branch 'master' into add-unity-test
Chernobrovkin-AD Apr 4, 2025
70721ba
Add test and sample on variable offset
Chernobrovkin-AD Apr 5, 2025
4bba7ae
Add test and sample on variable offset
Chernobrovkin-AD Apr 5, 2025
edc3858
Add test and sample on variable offset
Chernobrovkin-AD Apr 5, 2025
41b8a70
"If" conditions cleaning
Chernobrovkin-AD Apr 5, 2025
ae71c1a
Add concurrency control to Unity workflow
Chernobrovkin-AD Apr 5, 2025
dcd7094
Update workflow dependencies to ensure proper execution sequence
Chernobrovkin-AD Apr 5, 2025
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
21 changes: 21 additions & 0 deletions .github/workflows/build-test-distribute.yml
Original file line number Diff line number Diff line change
@@ -14,6 +14,10 @@ on:
- cron: '0 17 * * *' # Run every day at 17:00 UTC
#- cron: '0 6 * * *' # Run every day at 6 AM UTC

permissions:
id-token: write
contents: read

jobs:
# NOTE: all output values are strings
# use the ${{ needs.config.outputs.bool-param == 'true' }} construction to check boolean values
@@ -248,6 +252,23 @@ jobs:
path: MeshLib.nupkg
retention-days: 1

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::259351611210:role/GitHubMeshLibAwsCredsRole
aws-region: us-east-1

- name: Upload NuGet Package to S3
shell: powershell
run: aws s3 cp MeshLib.nupkg 's3://test-artifacts-git/MeshLib.nupkg' --quiet

windows-unity-test:
needs:
- create-nuget-package
- windows-build-test
if: ${{ github.event_name == 'schedule' }} // triggered by schedule
uses: ./.github/workflows/unity-nuget-test.yml

upload-distributions:
if: ${{ !cancelled() && needs.config.outputs.upload_artifacts == 'true' }}
timeout-minutes: 10
1 change: 0 additions & 1 deletion .github/workflows/sign-upload-nuget.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ on:
release:
types: [ published ]
workflow_dispatch:


jobs:
setup:
76 changes: 75 additions & 1 deletion .github/workflows/unity-nuget-test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: Test Nuget package with Unity
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@@ -7,14 +8,87 @@ permissions:
id-token: write
contents: read

concurrency:
group: unity-test
cancel-in-progress: false

jobs:
start-unity-instance:
name: Start unity instance
runs-on: aws-micro
outputs:
instance_started: ${{ steps.set-output.outputs.instance_started }}
steps:
- name: Configure AWS Credentials (OIDC)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::259351611210:role/GitHubMeshLibAwsStartStopInstances
aws-region: us-east-1
- name: Start Instance
run: |
aws ec2 start-instances --instance-ids ${{ vars.UNITY_INSTANCE_ID }}
- name: Wait Instance
run: |
aws ec2 wait instance-status-ok --instance-ids ${{ vars.UNITY_INSTANCE_ID }}

unity-nuget-test:
timeout-minutes: 10
needs: [ start-unity-instance ]
runs-on: [ self-hosted, windows, x64, unity, meshinspector ]

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::259351611210:role/EC2Github
aws-region: us-east-1

- name: Copy nupkg from S3
shell: powershell
# We use the constant fake version 1.0.0.3468 to simplify test workflow for Install package step
run: aws s3 cp s3://test-artifacts-git/MeshLib.nupkg C:/work/nuget_repo/MeshLib.1.0.0.3468.nupkg --quiet

- name: rm previous data
shell: powershell
run: |
Remove-Item -Path "C:\work\unity_proj\NugetTestProj\Assets\Packages" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "C:\work\results.xml" -ErrorAction SilentlyContinue
Remove-Item -Path "C:\work\batch_log.txt" -ErrorAction SilentlyContinue

- name: Install nuget package
shell: powershell
run: |
C:\\Users\\Administrator\\.dotnet\\tools\\nugetforunity.exe restore "C:\work\unity_proj\NugetTestProj"

- name: Run test
shell: powershell
run: |
Start-Process -FilePath "C:\work\unity_editor\6000.0.40f1\Editor\Unity.exe" -ArgumentList "-runTests", "-batchmode", "-projectPath", "C:\work\unity_proj\NugetTestProj", "-testPlatform", "playmode", "-testResults", "C:\work\results.xml", "-logfile", "C:\work\batch_log.txt" -Wait


- name: verify xml
shell: powershell
run: |
[xml]$xml = Get-Content "C:\work\results.xml"
if ($xml.'test-run'.failed -eq "0") { Write-Output "All tests passed"; exit 0 } else { Write-Output "Errors in results.xml found"; exit 1}

- name: upload logs
if: always()
shell: powershell
run: |
aws s3 cp C:\work\batch_log.txt s3://test-artifacts-git/batch_log.txt
aws s3 cp C:\work\results.xml s3://test-artifacts-git/results.xml


stop-instance:
runs-on: aws-micro
needs: [ unity-nuget-test ]
if: always()
steps:
- name: Configure AWS Credentials (OIDC)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::259351611210:role/GitHubMeshLibAwsStartStopInstances
aws-region: us-east-1
- name: Stop Instance
run: |
aws ec2 stop-instances --instance-ids ${{ vars.UNITY_INSTANCE_ID }}