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

Support windows #27

Merged
merged 1 commit into from
Feb 4, 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
2 changes: 1 addition & 1 deletion .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fi

# If dist/ was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ jobs:
run: npm run fmt:check

test-action:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3

- name: Get scarb version
id: extractScarbVersion
shell: bash
run: |
snfoundry_version=$(curl -s https://api.github.com/repos/foundry-rs/starknet-foundry/releases/latest | grep tarball_url | awk -F '/' '{print $8}' | tr -d '",')
version=$(curl -s https://raw.githubusercontent.com/foundry-rs/starknet-foundry/$snfoundry_version/.tool-versions | awk '{print $2}')
Expand All @@ -58,11 +62,15 @@ jobs:
working-directory: myproject

test-action-with-tools-file:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3

- name: "Create .tool-versions file"
shell: bash
run: echo -en 'scarb 2.5.0 \nstarknet-foundry 0.16.0' > .tool-versions

- name: "Setup Scarb using `.tool-versions` file"
Expand All @@ -72,3 +80,4 @@ jobs:
uses: ./

- run: snforge --version | grep "snforge 0.16.0"
shell: bash
10 changes: 8 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ outputs:
starknet-foundry-version:
description: The version of installed Starknet Foundry
runs:
using: node20
main: "dist/index.js"
using: "composite"
steps:
- name: Set up Universal Sierra Compiler
uses: software-mansion/setup-universal-sierra-compiler@v1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means usc is implicitly included each time someone uses snfoundry action? if so - neat.
how did you test this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means usc is implicitly included each time someone uses snfoundry action? if so - neat.
Yep setup-snfoundry action automatically installs usc
how did you test this?

This part of ci is testing it:
https://github.com/foundry-rs/setup-snfoundry/blob/106e83ff8dca36e29fd972d68127540fe7355e71/.github/workflows/checks.yml#L45C1-L51C49


- name: Set up Starknet Foundry
shell: bash
run: node dist/index.js
16 changes: 0 additions & 16 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29998,21 +29998,6 @@ async function findStarknetFoundryDir(extractedPath) {
);
}

async function downloadUniversalSierraCompiler() {
const scriptUrl =
"https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh";

try {
const scriptPath = await tool_cache.downloadTool(scriptUrl);

await exec.exec(`chmod +x ${scriptPath}`);

await exec.exec(scriptPath);
} catch (error) {
core.setFailed(error.message);
}
}

;// CONCATENATED MODULE: ./lib/main.js


Expand Down Expand Up @@ -30048,7 +30033,6 @@ async function main() {
triplet,
);
if (!StarknetFoundryPrefix) {
await downloadUniversalSierraCompiler();
const download = await downloadStarknetFoundry(
StarknetFoundryRepo,
StarknetFoundryVersion,
Expand Down
15 changes: 0 additions & 15 deletions lib/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,3 @@ async function findStarknetFoundryDir(extractedPath) {
`could not find Starknet Foundry directory in ${extractedPath}`,
);
}

export async function downloadUniversalSierraCompiler() {
const scriptUrl =
"https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh";

try {
const scriptPath = await tc.downloadTool(scriptUrl);

await exec.exec(`chmod +x ${scriptPath}`);

await exec.exec(scriptPath);
} catch (error) {
core.setFailed(error.message);
}
}
1 change: 0 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export default async function main() {
triplet,
);
if (!StarknetFoundryPrefix) {
await downloadUniversalSierraCompiler();
const download = await downloadStarknetFoundry(
StarknetFoundryRepo,
StarknetFoundryVersion,
Expand Down
Loading