working on buildscript
This commit is contained in:
parent
ab4e190d47
commit
f88e10b034
|
@ -1,66 +1,19 @@
|
||||||
name: website
|
name: CI
|
||||||
|
|
||||||
#on: [push] # debugging only
|
on: [push, pull_request]
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '[0-9]+.[0-9]+.[0-9]+'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
with:
|
||||||
- name: Set output
|
submodules: true
|
||||||
id: vars
|
- uses: iffy/install-nim@v3
|
||||||
run: echo ::set-output name=tag::${GITHUB_REF:10}
|
- name: Build
|
||||||
- name: Cache choosenim
|
run: nimble install -y
|
||||||
id: cache-choosenim
|
- name: Test
|
||||||
uses: actions/cache@v1
|
run: nimble test -y
|
||||||
with:
|
|
||||||
path: ~/.choosenim
|
|
||||||
key: ${{ runner.os }}-choosenim-stable
|
|
||||||
- name: Cache nimble
|
|
||||||
id: cache-nimble
|
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
|
||||||
path: ~/.nimble
|
|
||||||
key: ${{ runner.os }}-nimble-stable
|
|
||||||
- uses: jiro4989/setup-nim-action@v1
|
|
||||||
with:
|
|
||||||
nim-version: 'stable'
|
|
||||||
- name: Install libsnappy
|
|
||||||
run: sudo apt-get install libsnappy1v5
|
|
||||||
- name: Install leveldb c library
|
|
||||||
run: |
|
|
||||||
wget http://ftp.us.debian.org/debian/pool/main/l/leveldb/libleveldb1d_1.22-3_amd64.deb
|
|
||||||
wget http://ftp.us.debian.org/debian/pool/main/l/leveldb/libleveldb-dev_1.22-3_amd64.deb
|
|
||||||
sudo dpkg -i *.deb
|
|
||||||
- name: Build and test
|
|
||||||
env:
|
|
||||||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
|
|
||||||
run: |
|
|
||||||
nimble build -Y
|
|
||||||
nimble test -Y
|
|
||||||
- name: Build doc
|
|
||||||
env:
|
|
||||||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
|
|
||||||
run: |
|
|
||||||
# Due to bug https://github.com/nim-lang/Nim/issues/14281, compile the documentation separately.
|
|
||||||
nimble doc --project --git.url:https://github.com/$GITHUB_REPOSITORY --git.commit:$RELEASE_VERSION src/leveldb.nim
|
|
||||||
find .
|
|
||||||
# Deploying documentation of the latest version.
|
|
||||||
mkdir -p ./public
|
|
||||||
mv src/htmldocs/* public/
|
|
||||||
cd ./public/
|
|
||||||
ln -s ./leveldb.html index.html
|
|
||||||
cd ../
|
|
||||||
- name: Deploy
|
|
||||||
if: success()
|
|
||||||
uses: crazy-max/ghaction-github-pages@v1.3.0
|
|
||||||
with:
|
|
||||||
target_branch: gh-pages
|
|
||||||
build_dir: ./public
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
30
build.sh
30
build.sh
|
@ -6,11 +6,27 @@ if ! [ -x "$(command -v toast)" ]; then
|
||||||
nimble install -y nimterop@0.6.13
|
nimble install -y nimterop@0.6.13
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cmake -S "${root}/sources" -B "${root}/build"
|
||||||
|
|
||||||
|
# prelude: not needed?
|
||||||
|
|
||||||
|
echo >> "${root}/leveldb.nim"
|
||||||
|
|
||||||
|
# assemble files to be compiled:
|
||||||
|
extensions="c cc cpp"
|
||||||
|
for ext in ${extensions}; do
|
||||||
|
echo ${ext}
|
||||||
|
for file in `find "${root}/sources" -type f -name "*.${ext}"`; do
|
||||||
|
echo ${file}
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
# generate nim wrapper with nimterop
|
# generate nim wrapper with nimterop
|
||||||
toast \
|
#toast \
|
||||||
--compile="${root}/sources/randombytes.c" \
|
# --compile="${root}/sources/randombytes.c" \
|
||||||
--compile="${root}/sources/hazmat.c" \
|
# --compile="${root}/sources/hazmat.c" \
|
||||||
--pnim \
|
# --pnim \
|
||||||
--noHeader \
|
# --noHeader \
|
||||||
"${root}/sources/randombytes.h" \
|
# "${root}/sources/randombytes.h" \
|
||||||
"${root}/sources/hazmat.h" > "${root}/sss/cwrapper.nim"
|
# "${root}/sources/hazmat.h" > "${root}/sss/cwrapper.nim"
|
||||||
|
~ ~ ~
|
Loading…
Reference in New Issue