Skip to content

[CI] Use diff token to download artifacts in zombienet tests #9286

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 28 additions & 1 deletion .github/workflows/zombienet-reusable-preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ on:
TEST_MATRIX:
value: ${{ jobs.preflight.outputs.TEST_MATRIX }}
description: |
JSON formatted test matrix parsed from test yaml
JSON formatted test matrix parsed from test yaml.
DOWNLOADER_APP_TOKEN:
value: ${{ jobs.preflight.outputs.DOWNLOADER_APP_TOKEN }}
description: |
A separate token to download artifacts between zombienet actions.
jobs:
#
#
Expand Down Expand Up @@ -186,6 +191,9 @@ jobs:
ZOMBIENET_SDK_DEFAULT_RUNNER: ${{ steps.set_vars.outputs.ZOMBIENET_SDK_DEFAULT_RUNNER }}
ZOMBIENET_SDK_LARGE_RUNNER: ${{ steps.set_vars.outputs.ZOMBIENET_SDK_LARGE_RUNNER }}

# app-token to download artifacts with a better rate-limit
DOWNLOADER_APP_TOKEN: ${{ steps.set_downloader_key.outputs.DOWNLOADER_APP_TOKEN }}

steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -294,6 +302,25 @@ jobs:
echo "ZOMBIENET_IMAGE: ${{ steps.set_vars.outputs.ZOMBIENET_IMAGE }}"
echo "ZOMBIENET_SDK_IMAGE: ${{ steps.set_vars.outputs.ZOMBIENET_SDK_IMAGE }}"
- uses: actions/create-github-app-token@v2
id: app-token
if: ${{ !github.event.pull_request.head.repo.fork }}
with:
app-id: ${{ secrets.ARTIFACTS_DOWNLOADER_APP_ID }}
private-key: ${{ secrets.ARTIFACTS_DOWNLOADER_PRIVATE_KEY }}

- name: Set Downloader token
id: set_downloader_key
shell: bash
env:
IS_FORK: ${{ github.event.pull_request.head.repo.fork }}
run: |
if [ $IS_FORK == 'true' ];then
echo "DOWNLOADER_APP_TOKEN=${{ github.token }}" >> $GITHUB_OUTPUT
else
echo "DOWNLOADER_APP_TOKEN=${{ steps.app-token.outputs.token }}" >> $GITHUB_OUTPUT
fi;
- name: Generate test matrix
id: generate_test_matrix
shell: bash
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/zombienet_cumulus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
with:
tests_yaml: .github/zombienet-tests/zombienet_cumulus_tests.yml
test_pattern: ${{ inputs.test_pattern }}
secrets: inherit


zombienet-cumulus-tests:
Expand Down Expand Up @@ -89,6 +90,6 @@ jobs:
test-filter: ${{ matrix.test.test-filter }}
job-name: ${{ matrix.test.job-name }}
prefix: "cumulus"
gh-token: ${{ secrets.GITHUB_TOKEN }}
gh-token: ${{ needs.preflight.outputs.DOWNLOADER_APP_TOKEN }}
build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }}
ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
2 changes: 1 addition & 1 deletion .github/workflows/zombienet_parachain-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ jobs:
test-filter: ${{ matrix.test.test-filter }}
job-name: ${{ matrix.test.job-name }}
prefix: "parachain-templates"
gh-token: ${{ secrets.GITHUB_TOKEN }}
gh-token: ${{ needs.preflight.outputs.DOWNLOADER_APP_TOKEN }}
build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }}
ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
2 changes: 1 addition & 1 deletion .github/workflows/zombienet_polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ jobs:
test-filter: ${{ matrix.test.test-filter }}
job-name: ${{ matrix.test.job-name }}
prefix: "polkadot"
gh-token: ${{ secrets.GITHUB_TOKEN }}
gh-token: ${{ needs.preflight.outputs.DOWNLOADER_APP_TOKEN }}
build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }}
ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
3 changes: 2 additions & 1 deletion .github/workflows/zombienet_substrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
with:
tests_yaml: .github/zombienet-tests/zombienet_substrate_tests.yml
test_pattern: ${{ inputs.test_pattern }}
secrets: inherit

zombienet-substrate-tests:
name: ${{ matrix.test.job-name }}
Expand Down Expand Up @@ -81,6 +82,6 @@ jobs:
job-name: ${{ matrix.test.job-name }}
local-dir: ${{ matrix.test.local-dir }}
concurrency: ${{ matrix.test.concurrency || 1 }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
gh-token: ${{ needs.preflight.outputs.DOWNLOADER_APP_TOKEN }}
build-id: ${{ needs.preflight.outputs.BUILD_RUN_ID }}
ref-slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
Loading