Improve CI (#72)
This commit is contained in:
parent
fa70abac23
commit
b05745c9ce
4 changed files with 45 additions and 54 deletions
34
.github/actions/ruby_install/action.yml
vendored
Normal file
34
.github/actions/ruby_install/action.yml
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
name: "Install Ruby"
|
||||
|
||||
inputs:
|
||||
ruby-version:
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup env
|
||||
shell: bash
|
||||
run: |
|
||||
echo "PATH=/opt/rubies/${{ inputs.ruby-version }}/bin:$PATH" >> $GITHUB_ENV
|
||||
echo "GEM_HOME=~/.gem/ruby/${{ inputs.ruby-version }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
|
||||
with:
|
||||
path: |
|
||||
/opt/rubies/${{ inputs.ruby-version }}
|
||||
~/.gem/ruby/${{ inputs.ruby-version }}
|
||||
key: ruby-static-${{ runner.os }}-${{ inputs.ruby-version }}
|
||||
|
||||
- name: Build static ruby
|
||||
working-directory: /tmp
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -d /opt/rubies/${{inputs.ruby-version }} ]; then
|
||||
echo "Ruby ${{ inputs.ruby-version }} already installed, skipping build"
|
||||
else
|
||||
git clone https://github.com/rbenv/ruby-build.git
|
||||
PREFIX=/usr/local sudo -E ./ruby-build/install.sh
|
||||
CC=clang RUBY_CONFIGURE_OPTS="--disable-shared" sudo -E ruby-build ${{ inputs.ruby-version }} /opt/rubies/${{ inputs.ruby-version }}
|
||||
fi
|
||||
31
.github/workflows/book.yml
vendored
31
.github/workflows/book.yml
vendored
|
|
@ -10,35 +10,10 @@ jobs:
|
|||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/ruby_install
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Cache Ruby
|
||||
id: cache-ruby
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: rubies
|
||||
key: ${{ runner.os }}-ruby
|
||||
- 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
|
||||
echo $prefix/bin >> $GITHUB_PATH
|
||||
- name: Add Ruby to PATH
|
||||
run: |
|
||||
prefix=`pwd`/rubies/ruby-3.4
|
||||
echo $prefix/bin >> $GITHUB_PATH
|
||||
ruby-version: "3.4.4"
|
||||
- name: Install latest mdbook
|
||||
run: |
|
||||
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
|
||||
|
|
|
|||
33
.github/workflows/rust.yml
vendored
33
.github/workflows/rust.yml
vendored
|
|
@ -11,36 +11,19 @@ env:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RUSTFLAGS: -D warnings
|
||||
strategy:
|
||||
matrix:
|
||||
ruby-version: ["3.4.4"]
|
||||
sys:
|
||||
- os: ubuntu-latest
|
||||
runs-on: ${{ matrix.sys.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Cache Ruby
|
||||
id: cache-ruby
|
||||
uses: actions/cache@v4
|
||||
- uses: ./.github/actions/ruby_install
|
||||
with:
|
||||
path: rubies
|
||||
key: ${{ runner.os }}-ruby
|
||||
- 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
|
||||
ruby-version: ${{ matrix.ruby-version }}
|
||||
- name: Clippy
|
||||
run: cargo clippy --all-features --verbose -- -D warnings
|
||||
- name: Build
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
[book]
|
||||
authors = ["Jaroslaw Konik"]
|
||||
language = "en"
|
||||
multilingual = false
|
||||
src = "src"
|
||||
title = "bevy_scriptum"
|
||||
|
|
|
|||
Loading…
Reference in a new issue