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

fix(ci): setup test #1966

Merged
merged 4 commits into from
Feb 20, 2025
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
24 changes: 24 additions & 0 deletions .github/workflows/setup-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,28 @@ concurrency:
env:
ZOMBIE_TRACE: 1
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZOMBIE_RELEASES_FILE: /tmp/releases.json

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:
needs: [get_releases]
strategy:
matrix:
target: [ubuntu-latest, macos-latest]
Expand All @@ -32,6 +49,13 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Download request file
uses: actions/[email protected]
with:
name: releases-${{ github.sha }}.json
- run: |
ls -l
mv releases.json /tmp
- run: npm install && npm update
working-directory: "./javascript"
- run: npm run build
Expand Down
8 changes: 8 additions & 0 deletions javascript/packages/cli/src/actions/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,14 @@ const downloadBinaries = async (binaries: string[]): Promise<void> => {
};

const getAllReleases = async (repo: string): Promise<any> => {
// 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 = {
Expand Down
Loading