Skip to content
Open
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
64 changes: 49 additions & 15 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [windows-latest]
env:
RUSTFLAGS: -D warnings
steps:
Expand All @@ -24,23 +28,53 @@ jobs:
key: ${{ runner.os }}-ruby
- name: Install Ruby
if: steps.cache-ruby.outputs.cache-hit != 'true'
env:
CC: clang
shell: pwsh
run: |
url="https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.4.tar.gz"
prefix=`pwd`/rubies/ruby-3.4
mkdir rubies
mkdir ruby_src
curl -sSL $url | tar -xz
cd ruby-3.4.4
mkdir build
cd build
../configure --without-shared --prefix=$prefix
make install
$url = "https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.4.tar.gz"
$prefix = "$(Get-Location)\rubies\ruby-3.4"
New-Item -ItemType Directory -Force -Path rubies | Out-Null
New-Item -ItemType Directory -Force -Path ruby_src | Out-Null
Invoke-WebRequest -Uri $url -OutFile ruby.tar.gz
tar -xzf ruby.tar.gz -C ruby_src
Set-Location ruby_src\ruby-3.4.4
# Note: Ruby doesn't easily build on Windows without MSYS2 or similar.
# This is a placeholder - recommend using prebuilt Ruby installer instead.
echo "Ruby build on Windows not implemented in this workflow."

- name: Install Ruby via RubyInstaller (Recommended)
if: steps.cache-ruby.outputs.cache-hit != 'true'
shell: pwsh
run: |
$url = "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.2.2-1/rubyinstaller-3.2.2-1-x64.exe"
$installer = "rubyinstaller.exe"
Invoke-WebRequest -Uri $url -OutFile $installer
Start-Process -FilePath .\$installer -ArgumentList "/verysilent /dir=$env:GITHUB_WORKSPACE\rubies\ruby-3.2" -Wait
echo "Installed Ruby"

- name: Add Ruby to PATH
shell: pwsh
run: |
prefix=`pwd`/rubies/ruby-3.4
echo $prefix/bin >> $GITHUB_PATH
$rubyPath = "$env:GITHUB_WORKSPACE\rubies\ruby-3.2\bin"
echo $rubyPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# - name: Install Ruby
# if: steps.cache-ruby.outputs.cache-hit != 'true'
# env:
# CC: clang
# run: |
# url="https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.4.tar.gz"
# prefix=`pwd`/rubies/ruby-3.4
# mkdir rubies
# mkdir ruby_src
# curl -sSL $url | tar -xz
# cd ruby-3.4.4
# mkdir build
# cd build
# ../configure --without-shared --prefix=$prefix
# make install
# - name: Add Ruby to PATH
# run: |
# prefix=`pwd`/rubies/ruby-3.4
# echo $prefix/bin >> $GITHUB_PATH
- name: Clippy
run: cargo clippy --all-features --verbose -- -D warnings
- name: Build
Expand Down
Loading