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

ci: use token to run gh #66

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
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
12 changes: 9 additions & 3 deletions .github/actions/benchmark-progress-comment/action.yaml
Original file line number Diff line number Diff line change
@@ -1,15 1,18 @@
name: Benchmark progress comment
description: Comment benchmark progtress to the PR or Issue
inputs:
comment:
description: Comment to be posted
required: true
github-token:
description: GitHub token
required: true
state:
description: State of the benchmark (running|failed|success)
required: true
title:
description: Title of the comment
required: true
comment:
description: Comment to be posted
required: true
update:
description: Update comment or not (true|false)
required: true
Expand All @@ -25,3 28,6 @@ runs:

${{ inputs.comment }}"
gh issue comment ${{ github.event.issue.number }} --body "$body"
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ inputs.github-token }}
20 changes: 13 additions & 7 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 100,19 @@ jobs:
- name: Comment (Running - Auth OK)
uses: Cysharp/Actions/.github/actions/benchmark-progress-comment@main
with:
comment: "Authorization complete, start creating benchmark environment."
github-token: ${{ secrets.GITHUB_TOKEN }}
state: "running"
title: "Successfully start benchmark"
comment: "Authorization complete, start creating benchmark environment."
update: "false"
if: ${{ github.event.issue.number && steps.is-benchmarkable.outputs.authorized == 'true' }}
- name: Comment (Failed - Auth)
uses: Cysharp/Actions/.github/actions/benchmark-progress-comment@main
with:
comment: "Authorization failed, You are not authorized to run benchmark."
github-token: ${{ secrets.GITHUB_TOKEN }}
state: "failed"
title: "Failed to run benchmark"
comment: "Authorization failed, You are not authorized to run benchmark."
update: "false"
if: ${{ github.event.issue.number && steps.is-benchmarkable.outputs.authorized == 'false' }}

Expand Down Expand Up @@ -161,9 163,10 @@ jobs:
- name: Comment (Pgoress - Benchmark environment)
uses: Cysharp/Actions/.github/actions/benchmark-progress-comment@main
with:
comment: "Benchmark environment creation complete, start preparing server & client."
github-token: ${{ secrets.GITHUB_TOKEN }}
state: "running"
title: "Benchmark environment created"
comment: "Benchmark environment creation complete, start preparing server & client."
update: "true"
if: ${{ github.event.issue.number }}
- name: Setup .NET on Benchmark VM
Expand Down Expand Up @@ -191,9 194,10 @@ jobs:
- name: Comment (Progress - Benchmark begin)
uses: Cysharp/Actions/.github/actions/benchmark-progress-comment@main
with:
comment: "Server successfully started, starting benchmark."
github-token: ${{ secrets.GITHUB_TOKEN }}
state: "running"
title: "Benchmark begin"
comment: "Server successfully started, starting benchmark."
update: "true"
if: ${{ github.event.issue.number }}
- name: Run benchmark client on VM
Expand All @@ -205,20 209,22 @@ jobs:
- name: Comment (Result - Benchmark complete)
uses: Cysharp/Actions/.github/actions/benchmark-progress-comment@main
with:
state: "running"
title: "Benchmark completed"
comment: |
Benchmark complete!
* client-args: ${{ inputs.client-benchmark-script-args }}
* server-args: ${{ inputs.server-benchmark-script-args }}
github-token: ${{ secrets.GITHUB_TOKEN }}
state: "running"
title: "Benchmark completed"
update: "true"
if: ${{ github.event.issue.number }}
- name: Comment (Result - Benchmark failed)
uses: Cysharp/Actions/.github/actions/benchmark-progress-comment@main
with:
comment: Benchmark failed.
github-token: ${{ secrets.GITHUB_TOKEN }}
state: "running"
title: "Benchmark failed"
comment: Benchmark failed.
update: "true"
if: ${{ github.event.issue.number && failure() }}
# TODO: Add a step to collect benchmark results
Expand Down
2 changes: 1 addition & 1 deletion Sandbox/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 1,5 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.0.158</VersionPrefix>
<VersionPrefix>1.0.160</VersionPrefix>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Sandbox/Sandbox.Godot/addons/Foo/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 3,6 @@
name="Sandbox.Godot"
description="Sample."
author="Cysharp"
version="1.0.158"
version="1.0.160"
language="C-sharp"
script="GodotPlugin.cs"
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
{
"name": "com.unity.plugin.example",
"version": "1.0.158",
"version": "1.0.160",
"displayName": "Package Example Plugin",
"description": "This is an example package",
"unity": "2019.1",
Expand Down
2 changes: 1 addition & 1 deletion Sandbox/Sandbox.Unity/Assets/Plugins/Foo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
{
"name": "com.unity.example",
"version": "1.0.158",
"version": "1.0.160",
"displayName": "Package Example",
"description": "This is an example package",
"unity": "2019.1",
Expand Down
2 changes: 1 addition & 1 deletion Sandbox/VersionOutput/version.txt
Original file line number Diff line number Diff line change
@@ -1 1 @@
1.0.158
1.0.160