Skip to content

Commit

Permalink
fix: errors related to windows/linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ermineJose committed Nov 5, 2024
1 parent 8e81595 commit 502c230
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,26 +351,23 @@ jobs:
timeout-minutes: 2

- name: Estimate cost to create a vault
if: matrix.os != 'windows-latest'
run: |
echo "test-file" > upload-test.txt
./target/release/autonomi --log-output-dest=data-dir file upload ./upload-test.txt
# 1 MB
python3 -c "with open('random.txt', 'wb') as f: f.write(bytearray([0xff] * 1 * 1024 * 1024))"
./target/release/autonomi --log-output-dest=data-dir file upload random.txt
./target/release/autonomi --log-output-dest=data-dir register create sample_new_register 1234
./target/release/autonomi --log-output-dest=data-dir vault cost
./target/release/autonomi --log-output-dest=data-dir file list 2>&1 | tee file_list.txt
./target/release/autonomi --log-output-dest=data-dir register list 2>&1 | tee register_list.txt
env:
SN_LOG: "v"
timeout-minutes: 2

- name: create a vault with existing user data as above
if: matrix.os != 'windows-latest'
run: ./target/release/autonomi --log-output-dest=data-dir vault create
env:
SN_LOG: "v"
timeout-minutes: 2

- name: add more files
- name: add more files - linux/macos
if: matrix.os != 'windows-latest'
run: |
for i in {1..100}; do
Expand All @@ -383,18 +380,13 @@ jobs:
SN_LOG: "v"
timeout-minutes: 25

- name: add more files
- name: add more files - windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
for ($i = 1; $i -le 100; $i++) {
# Generate a random file with PowerShell
$randomData = [System.IO.File]::OpenWrite("random_file_$i.bin")
$buffer = New-Object byte[](1024 * 1024) # 1MB buffer
[System.Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($buffer)
$randomData.Write($buffer, 0, $buffer.Length)
$randomData.Close()
python3 -c "import sys; with open(sys.argv[1], 'wb') as f: f.write(bytearray([0xff] * 1 * 1024 * 1024))" "random_file_$i.bin"
# Run autonomi commands
./target/release/autonomi --log-output-dest=data-dir file upload "random_file_$i.bin" --public
./target/release/autonomi --log-output-dest=data-dir file upload "random_file_$i.bin"
Expand Down

0 comments on commit 502c230

Please sign in to comment.