Update deps script
This commit is contained in:
parent
9806b5d67a
commit
0320302786
|
@ -0,0 +1,54 @@
|
||||||
|
name: deps
|
||||||
|
description: 'Build and cache dependencies'
|
||||||
|
inputs:
|
||||||
|
deps-script-path:
|
||||||
|
description: 'Path of deps.sh script'
|
||||||
|
required: true
|
||||||
|
default: './deps.sh'
|
||||||
|
deps-bundle-path:
|
||||||
|
description: 'Path of deps-bundle.sh script'
|
||||||
|
required: true
|
||||||
|
default: './contrib/deps-bundle.sh'
|
||||||
|
outputs: {}
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Has apt-get?
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if command -v apt-get > /dev/null 2>&1; then
|
||||||
|
echo "HAS_APT_GET=1" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "HAS_APT_GET=0" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: apt-get update
|
||||||
|
shell: bash
|
||||||
|
run: sudo apt-get update
|
||||||
|
if: env.HAS_APT_GET == '1'
|
||||||
|
|
||||||
|
- id: deps-sh-hash
|
||||||
|
shell: bash
|
||||||
|
run: sha256sum '${{ inputs.deps-script-path }}' | awk '{print "HASH=" $1}' >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- id: deps-sh-cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: deps-bundle.tar.zst
|
||||||
|
key: ${{ runner.os }}-deps-sh-${{ steps.deps-sh-hash.outputs.HASH }}
|
||||||
|
|
||||||
|
- name: Install system level dependencies
|
||||||
|
shell: bash
|
||||||
|
run: '${{ inputs.deps-script-path }}' check
|
||||||
|
|
||||||
|
- name: Install dependencies from cache
|
||||||
|
shell: bash
|
||||||
|
run: tar -Izstd -xvf deps-bundle.tar.zst
|
||||||
|
if: steps.deps-sh-cache.outputs.cache-hit == 'true'
|
||||||
|
|
||||||
|
- name: Install dependencies from scratch
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
'${{ inputs.deps-script-path }}' install
|
||||||
|
'${{ inputs.deps-bundle-path }}'
|
||||||
|
if: steps.deps-sh-cache.outputs.cache-hit != 'true'
|
|
@ -8,18 +8,14 @@ jobs:
|
||||||
go-build:
|
go-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: ./.github/actions/deps
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.20.5
|
go-version: 1.22.0
|
||||||
|
|
||||||
- name: Fetch deps
|
|
||||||
run: |
|
|
||||||
# Hosted with Git LFS. See ./contrib/deps-bundle.sh
|
|
||||||
wget -q https://github.com/firedancer-io/radiance/raw/deps/deps-bundle.tar.zst
|
|
||||||
tar -I zstd -xf deps-bundle.tar.zst
|
|
||||||
|
|
||||||
- name: Vet
|
- name: Vet
|
||||||
run: source activate-opt && go vet ./...
|
run: source activate-opt && go vet ./...
|
||||||
|
|
|
@ -9,8 +9,6 @@ cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"/..
|
||||||
rm -f deps-bundle.tar.zst
|
rm -f deps-bundle.tar.zst
|
||||||
|
|
||||||
tar -Izstd -cf deps-bundle.tar.zst \
|
tar -Izstd -cf deps-bundle.tar.zst \
|
||||||
./opt/{include,lib,lib64}
|
./opt/{include,lib}
|
||||||
|
|
||||||
echo "[+] Created deps-bundle.tar.zst"
|
echo "[+] Created deps-bundle.tar.zst"
|
||||||
|
|
||||||
# Now you can commit this file to the deps branch of the repository
|
|
||||||
|
|
21
deps.sh
21
deps.sh
|
@ -297,7 +297,7 @@ install_zstd () {
|
||||||
cd ./opt/git/zstd/lib
|
cd ./opt/git/zstd/lib
|
||||||
|
|
||||||
echo "[+] Installing zstd to $PREFIX"
|
echo "[+] Installing zstd to $PREFIX"
|
||||||
"${MAKE[@]}" DESTDIR="$PREFIX" PREFIX="" install-pc install-static install-includes
|
"${MAKE[@]}" DESTDIR="$PREFIX" PREFIX="" MOREFLAGS="-fPIC" install-pc install-static install-includes
|
||||||
echo "[+] Successfully installed zstd"
|
echo "[+] Successfully installed zstd"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,13 +336,12 @@ install_lz4 () {
|
||||||
|
|
||||||
install_rocksdb () {
|
install_rocksdb () {
|
||||||
cd ./opt/git/rocksdb
|
cd ./opt/git/rocksdb
|
||||||
|
|
||||||
echo "[+] Configuring RocksDB"
|
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-G"Unix Makefiles" \
|
-G"Unix Makefiles" \
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH="" \
|
-DCMAKE_INSTALL_PREFIX:PATH="$PREFIX" \
|
||||||
|
-DCMAKE_INSTALL_LIBDIR="lib" \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DROCKSDB_BUILD_SHARED=OFF \
|
-DROCKSDB_BUILD_SHARED=OFF \
|
||||||
-DWITH_GFLAGS=OFF \
|
-DWITH_GFLAGS=OFF \
|
||||||
|
@ -364,21 +363,13 @@ install_rocksdb () {
|
||||||
-DSnappy_INCLUDE_DIRS="$PREFIX/include"
|
-DSnappy_INCLUDE_DIRS="$PREFIX/include"
|
||||||
echo "[+] Configured RocksDB"
|
echo "[+] Configured RocksDB"
|
||||||
|
|
||||||
echo "[+] Building RocksDB"
|
|
||||||
local NJOBS
|
local NJOBS
|
||||||
if [[ "$OS" == linux ]]; then
|
NJOBS=$(( $(nproc) / 2 ))
|
||||||
NJOBS=$(( $(nproc) / 2 ))
|
NJOBS=$((NJOBS>0 ? NJOBS : 1))
|
||||||
NJOBS=$((NJOBS>0 ? NJOBS : 1))
|
|
||||||
elif [[ "$OS" == darwin ]]; then
|
|
||||||
NJOBS=$(sysctl -n hw.physicalcpu)
|
|
||||||
else
|
|
||||||
NJOBS=2
|
|
||||||
fi
|
|
||||||
make -j $NJOBS
|
make -j $NJOBS
|
||||||
echo "[+] Successfully built RocksDB"
|
echo "[+] Successfully built RocksDB"
|
||||||
|
|
||||||
echo "[+] Installing RocksDB to $PREFIX"
|
echo "[+] Installing RocksDB to $PREFIX"
|
||||||
make install DESTDIR="$PREFIX"
|
make install
|
||||||
echo "[+] Successfully installed RocksDB"
|
echo "[+] Successfully installed RocksDB"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue