Skip to content

Commit 97be9e3

Browse files
authored
fix(ci): netsim commenting fixes (#2766)
## Description Adjusts permissions, uses proper input vars & the search & replace for comments is now aligned. Also adds examples to the list of possible executables for the job. Note: Docs still seem to fail in this PR with the set permissions. However write-all in a public repo is very constrained so it should be perfectly fine. The GITHUB_TOKEN has it by default, however I think since we're running sub jobs etc it's not propagating correctly. ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented.
1 parent 8420674 commit 97be9e3

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ jobs:
292292
command-arguments: "-Dwarnings"
293293

294294
netsim-integration-tests:
295+
permissions: write-all
295296
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
296297
uses: './.github/workflows/netsim_runner.yaml'
297298
secrets: inherit

.github/workflows/docs.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ env:
1717

1818
jobs:
1919
preview_docs:
20-
permissions:
21-
issues: write
22-
contents: write
20+
permissions: write-all
2321
timeout-minutes: 30
2422
name: Docs preview
2523
if: ${{ (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) && !github.event.pull_request.head.repo.fork }}

.github/workflows/netsim.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ env:
3131

3232
jobs:
3333
netsim-release:
34+
permissions: write-all
3435
if: ${{github.ref_name=='main' && github.event_name == 'push'}}
3536
uses: './.github/workflows/netsim_runner.yaml'
3637
secrets: inherit
@@ -44,6 +45,7 @@ jobs:
4445
build_profile: "optimized-release"
4546

4647
netsim-perf:
48+
permissions: write-all
4749
if: ${{github.event_name != 'push'}}
4850
uses: './.github/workflows/netsim_runner.yaml'
4951
secrets: inherit

.github/workflows/netsim_runner.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ env:
9494

9595
jobs:
9696
netsim:
97+
permissions: write-all
9798
name: Netsim
9899
timeout-minutes: 45
99100
runs-on: [self-hosted, linux, X64]
@@ -112,7 +113,7 @@ jobs:
112113

113114
- name: Build iroh
114115
run: |
115-
cargo build --profile ${{ inputs.build_profile }} --workspace --all-features
116+
cargo build --profile ${{ inputs.build_profile }} --workspace --all-features --examples --bins
116117
117118
- name: Fetch and build chuck
118119
run: |
@@ -131,6 +132,7 @@ jobs:
131132
132133
- name: Copy binaries to right location
133134
run: |
135+
cp target/${{inputs.build_profile}}/examples/* ../chuck/netsim/bins/
134136
cp target/${{inputs.build_profile}}/iroh ../chuck/netsim/bins/iroh
135137
cp target/${{inputs.build_profile}}/iroh-relay ../chuck/netsim/bins/iroh-relay
136138
cp ../chuck/target/release/chuck ../chuck/netsim/bins/chuck
@@ -196,13 +198,13 @@ jobs:
196198
with:
197199
issue-number: ${{ inputs.pr_number }}
198200
comment-author: 'github-actions[bot]'
199-
body-includes: Netsim report for this PR has been generated
201+
body-includes: Netsim report & logs for this PR have been generated
200202

201203
- name: Create or Update Docs Comment
202204
if: ${{ inputs.pr_number != '' }}
203205
uses: peter-evans/create-or-update-comment@v4
204206
with:
205-
issue-number: ${{ github.event.pull_request.number }}
207+
issue-number: ${{ inputs.pr_number }}
206208
comment-id: ${{ steps.fc.outputs.comment-id }}
207209
body: |
208210
Netsim report & logs for this PR have been generated and is available at: [LOGS](${{steps.upload-report.outputs.artifact-url}})

0 commit comments

Comments
 (0)