From d53ddee1f6c2b4affbf7a6cab18b3ce4c052ff50 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Wed, 19 Feb 2025 19:49:05 +0100 Subject: [PATCH 1/4] fix(ci): setup test --- .github/workflows/setup-tests.yml | 20 ++++++++++++++++++++ javascript/packages/cli/src/actions/setup.ts | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/.github/workflows/setup-tests.yml b/.github/workflows/setup-tests.yml index 00f97db71..786e89ccc 100644 --- a/.github/workflows/setup-tests.yml +++ b/.github/workflows/setup-tests.yml @@ -18,6 +18,21 @@ env: permissions: {} jobs: + get_releases: + # get the releases from macos is hitting the rate limit on the api constantly + # so, we download the whole info here and we share as artifact. + runs-on: ubuntu-latest + steps: + - name: perform_request + run: | + curl -s https://api.github.com/repos/paritytech/polkadot-sdk/releases > releases.json + - name: upload_releases + uses: actions/upload-artifact@v4 + with: + name: releases-${{ github.sha }}.json + path: | + releases.json + setup_test: strategy: matrix: @@ -32,6 +47,11 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' + - name: Download request file + uses: actions/download-artifact@v4.1.8 + with: + name: releases-${{ github.sha }}.json + - run: ls -l - run: npm install && npm update working-directory: "./javascript" - run: npm run build diff --git a/javascript/packages/cli/src/actions/setup.ts b/javascript/packages/cli/src/actions/setup.ts index 06b29e654..c98aa1c45 100644 --- a/javascript/packages/cli/src/actions/setup.ts +++ b/javascript/packages/cli/src/actions/setup.ts @@ -280,6 +280,14 @@ const downloadBinaries = async (binaries: string[]): Promise => { }; const getAllReleases = async (repo: string): Promise => { + // allow to read releases from file + if (process.env.ZOMBIE_RELEASES_FILE) { + const content = await fs.promises.readFile( + process.env.ZOMBIE_RELEASES_FILE, + ); + return JSON.parse(content.toString()); + } + const release_url = `https://api.github.com/repos/paritytech/${repo}/releases`; debug(`release url: ${release_url}`); const headers: any = { From 64163ea36cb564727cebfdfb04c23e1a37deeb6d Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Wed, 19 Feb 2025 20:05:54 +0100 Subject: [PATCH 2/4] fix env --- .github/workflows/setup-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/setup-tests.yml b/.github/workflows/setup-tests.yml index 786e89ccc..2859cdb4e 100644 --- a/.github/workflows/setup-tests.yml +++ b/.github/workflows/setup-tests.yml @@ -14,6 +14,7 @@ concurrency: env: ZOMBIE_TRACE: 1 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ZOMBIE_RELEASES_FILE: ./releases.json permissions: {} From d2d5e0fa87735608b16ae877f5f3b69df792d869 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Wed, 19 Feb 2025 20:09:36 +0100 Subject: [PATCH 3/4] fix env --- .github/workflows/setup-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/setup-tests.yml b/.github/workflows/setup-tests.yml index 2859cdb4e..e86fe54af 100644 --- a/.github/workflows/setup-tests.yml +++ b/.github/workflows/setup-tests.yml @@ -14,7 +14,7 @@ concurrency: env: ZOMBIE_TRACE: 1 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ZOMBIE_RELEASES_FILE: ./releases.json + ZOMBIE_RELEASES_FILE: /tmp/releases.json permissions: {} @@ -52,7 +52,9 @@ jobs: uses: actions/download-artifact@v4.1.8 with: name: releases-${{ github.sha }}.json - - run: ls -l + - run: | + ls -l + mv releases.json /tmp - run: npm install && npm update working-directory: "./javascript" - run: npm run build From 5d8504b71bdc6fab8aeb79706300a355227e43c8 Mon Sep 17 00:00:00 2001 From: Javier Viola Date: Wed, 19 Feb 2025 20:13:22 +0100 Subject: [PATCH 4/4] fix env --- .github/workflows/setup-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/setup-tests.yml b/.github/workflows/setup-tests.yml index e86fe54af..6ba482398 100644 --- a/.github/workflows/setup-tests.yml +++ b/.github/workflows/setup-tests.yml @@ -35,6 +35,7 @@ jobs: releases.json setup_test: + needs: [get_releases] strategy: matrix: target: [ubuntu-latest, macos-latest]