Skip to content

Commit

Permalink
Support windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ksew1 committed Feb 3, 2025
1 parent 106e83f commit 6f94dd8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 37 deletions.
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

- 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

0 comments on commit 6f94dd8

Please sign in to comment.