-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from bodo-run/quick-install
Quick install from bodo.run
- Loading branch information
Showing
13 changed files
with
1,048 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[target.x86_64-unknown-linux-gnu] | ||
rustflags = ["-C", "target-cpu=x86-64-v2"] | ||
|
||
[target.x86_64-apple-darwin] | ||
rustflags = ["-C", "target-cpu=x86-64-v2"] | ||
|
||
[target.aarch64-apple-darwin] | ||
rustflags = ["-C", "target-cpu=apple-m1"] | ||
|
||
[target.x86_64-pc-windows-msvc] | ||
rustflags = ["-C", "target-cpu=x86-64-v2"] | ||
|
||
[target.aarch64-pc-windows-msvc] | ||
rustflags = ["-C", "target-cpu=generic"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
--- | ||
name: Installation Test | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
test-unix-install: | ||
name: Test Unix Installation | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get install script | ||
id: get_linux_install_script | ||
shell: bash | ||
run: | | ||
script=$(awk '/<!-- LINUX_INSTALLATION_BEGIN -->/{p=1;next}/<!-- LINUX_INSTALLATION_END -->/{p=0}p' README.md | grep -v '^```') | ||
# Ensure script is not empty | ||
if [ -z "$script" ]; then | ||
echo "Error: Could not extract Linux installation script from README.md" | ||
exit 1 | ||
fi | ||
# Escape multiline output | ||
script="${script//'%'/'%25'}" | ||
script="${script//$'\n'/'%0A'}" | ||
script="${script//$'\r'/'%0D'}" | ||
echo "script=$script" >> $GITHUB_OUTPUT | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.target }} | ||
|
||
- name: Build yek | ||
shell: bash | ||
run: | | ||
cargo build --release --target ${{ matrix.target }} --locked | ||
# Verify binary exists | ||
binary="target/${{ matrix.target }}/release/yek" | ||
if [ ! -f "$binary" ]; then | ||
echo "Error: Binary not found at: $binary" | ||
find target -name "yek" -o -name "yek.exe" | ||
exit 1 | ||
fi | ||
ls -l "$binary" | ||
- name: Setup test environment | ||
shell: bash | ||
run: | | ||
# Create test directory | ||
sudo mkdir -p /usr/local/bin | ||
# Copy binary | ||
sudo cp "target/${{ matrix.target }}/release/yek" /usr/local/bin/ | ||
# Make executable | ||
sudo chmod +x /usr/local/bin/yek | ||
# Verify binary is executable | ||
if ! which yek; then | ||
echo "Error: yek not found in PATH after manual installation" | ||
echo "PATH: $PATH" | ||
exit 1 | ||
fi | ||
- name: Test installation script | ||
run: ${{ steps.get_linux_install_script.outputs.script }} | ||
|
||
- name: Verify installation | ||
run: | | ||
# Ensure yek is in PATH | ||
which yek || { | ||
echo "Error: yek not found in PATH" | ||
echo "PATH: $PATH" | ||
exit 1 | ||
} | ||
# Test version output | ||
yek --version || { | ||
echo "Error: yek --version failed" | ||
exit 1 | ||
} | ||
# Create test file | ||
echo "test content" > test.txt | ||
# Test basic functionality | ||
yek test.txt || { | ||
echo "Error: yek failed to process test file" | ||
exit 1 | ||
} | ||
# Verify output exists | ||
test -f repo-serialized/chunk-0.txt || { | ||
echo "Error: Output file not found" | ||
ls -la repo-serialized/ || true | ||
exit 1 | ||
} | ||
test-windows-install: | ||
name: Test Windows Installation | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get install script | ||
id: get_windows_install_script | ||
shell: bash | ||
run: | | ||
script=$(awk '/<!-- WINDOWS_INSTALLATION_BEGIN -->/{p=1;next}/<!-- WINDOWS_INSTALLATION_END -->/{p=0}p' README.md | grep -v '^```') | ||
# Ensure script is not empty | ||
if [ -z "$script" ]; then | ||
echo "Error: Could not extract Windows installation script from README.md" | ||
exit 1 | ||
fi | ||
# Escape multiline output | ||
script="${script//'%'/'%25'}" | ||
script="${script//$'\n'/'%0A'}" | ||
script="${script//$'\r'/'%0D'}" | ||
echo "script=$script" >> $GITHUB_OUTPUT | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: x86_64-pc-windows-msvc | ||
|
||
- name: Build yek | ||
shell: powershell | ||
run: | | ||
cargo build --release --target x86_64-pc-windows-msvc --locked | ||
# Verify binary exists | ||
$binary = "target\x86_64-pc-windows-msvc\release\yek.exe" | ||
if (-not (Test-Path $binary)) { | ||
Write-Error "Binary not found at: $binary" | ||
Get-ChildItem target -Recurse | Where-Object { $_.Name -like "yek.exe" } | ||
exit 1 | ||
} | ||
Write-Host "Binary size: $((Get-Item $binary).Length) bytes" | ||
- name: Setup test environment | ||
shell: powershell | ||
run: | | ||
# Create test directory | ||
New-Item -ItemType Directory -Path "$env:USERPROFILE\.local\bin" -Force | ||
# Add to PATH | ||
$env:Path = "$env:USERPROFILE\.local\bin;" + $env:Path | ||
# Copy binary | ||
Copy-Item "target\x86_64-pc-windows-msvc\release\yek.exe" "$env:USERPROFILE\.local\bin\yek.exe" | ||
# Verify binary is executable | ||
if (-not (Get-Command yek -ErrorAction SilentlyContinue)) { | ||
Write-Error "yek not found in PATH after manual installation" | ||
Write-Host "PATH: $env:Path" | ||
exit 1 | ||
} | ||
- name: Test installation script | ||
shell: powershell | ||
run: ${{ steps.get_windows_install_script.outputs.script }} | ||
|
||
- name: Verify installation | ||
shell: powershell | ||
run: | | ||
# Ensure yek is in PATH | ||
if (-not (Get-Command yek -ErrorAction SilentlyContinue)) { | ||
Write-Error "yek not found in PATH" | ||
Write-Host "PATH: $env:PATH" | ||
exit 1 | ||
} | ||
# Test version output | ||
$version = yek --version | ||
if (-not $?) { | ||
Write-Error "yek --version failed" | ||
exit 1 | ||
} | ||
Write-Host "Version: $version" | ||
# Create test file | ||
"test content" | Out-File -FilePath test.txt -Encoding utf8 | ||
# Test basic functionality | ||
yek test.txt | ||
if (-not $?) { | ||
Write-Error "yek failed to process test file" | ||
exit 1 | ||
} | ||
# Verify output exists | ||
if (-not (Test-Path repo-serialized/chunk-0.txt)) { | ||
Write-Error "Output file not found" | ||
Get-ChildItem repo-serialized -ErrorAction SilentlyContinue | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"branches": ["main"], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github" | ||
] | ||
} |
Oops, something went wrong.