test build
This commit is contained in:
parent
fa70abac23
commit
210c0ec8b2
1 changed files with 35 additions and 22 deletions
57
.github/workflows/rust.yml
vendored
57
.github/workflows/rust.yml
vendored
|
|
@ -14,33 +14,46 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: -D warnings
|
RUSTFLAGS: -D warnings
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
ruby_version: ["3.2.2"]
|
||||||
|
sys:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
rust_toolchain: stable
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Cache Ruby
|
- uses: oxidize-rb/actions/setup-ruby-and-rust@v1
|
||||||
id: cache-ruby
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
with:
|
||||||
path: rubies
|
ruby-version: none
|
||||||
key: ${{ runner.os }}-ruby
|
rustup-toolchain: ${{ matrix.sys.rust_toolchain }}
|
||||||
- name: Install Ruby
|
cargo-cache: "sccache"
|
||||||
if: steps.cache-ruby.outputs.cache-hit != 'true'
|
|
||||||
env:
|
- name: Setup env
|
||||||
CC: clang
|
|
||||||
run: |
|
run: |
|
||||||
url="https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.4.tar.gz"
|
echo "PATH=/opt/rubies/${{ matrix.ruby_version }}/bin:$PATH" >> $GITHUB_ENV
|
||||||
prefix=`pwd`/rubies/ruby-3.4
|
echo "GEM_HOME=~/.gem/ruby/${{ matrix.ruby_version }}" >> $GITHUB_ENV
|
||||||
mkdir rubies
|
|
||||||
mkdir ruby_src
|
- name: ⚡ Cache
|
||||||
curl -sSL $url | tar -xz
|
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
|
||||||
cd ruby-3.4.4
|
with:
|
||||||
mkdir build
|
path: |
|
||||||
cd build
|
/opt/rubies/${{ matrix.ruby_version }}
|
||||||
../configure --without-shared --prefix=$prefix
|
~/.gem/ruby/${{ matrix.ruby_version }}
|
||||||
make install
|
key: rb-sys-ruby-static-${{ matrix.sys.os }}-${{ matrix.ruby_version }}
|
||||||
- name: Add Ruby to PATH
|
|
||||||
|
- name: 🔘 Build static ruby
|
||||||
|
working-directory: /tmp
|
||||||
run: |
|
run: |
|
||||||
prefix=`pwd`/rubies/ruby-3.4
|
if [ -d /opt/rubies/${{matrix.ruby_version }} ]; then
|
||||||
echo $prefix/bin >> $GITHUB_PATH
|
echo "Ruby ${{ matrix.ruby_version }} already installed, skipping build"
|
||||||
|
else
|
||||||
|
git clone https://github.com/rbenv/ruby-build.git
|
||||||
|
PREFIX=/usr/local sudo ./ruby-build/install.sh
|
||||||
|
export MAKEFLAGS="-j$(nproc)"
|
||||||
|
export RUBY_CONFIGURE_OPTS="--disable-shared --disable-install-doc --disable-install-rdoc"
|
||||||
|
sudo ruby-build ${{ matrix.ruby_version }} /opt/rubies/${{ matrix.ruby_version }}
|
||||||
|
fi
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
run: cargo clippy --all-features --verbose -- -D warnings
|
run: cargo clippy --all-features --verbose -- -D warnings
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue