1212 runs-on : ubuntu-20.04
1313 steps :
1414 - uses : actions/checkout@v2
15+ with :
16+ fetch-depth : 0
1517 - name : deps
1618 run : |
1719 sudo apt-get install -y clang-format cppcheck python3-pip
2022 run : pre-commit run --all-files
2123 - name : mvn spotless:check
2224 run : mvn spotless:check -B -f bindings/jdbc/genomicsqlite-jdbc/pom.xml
25+ - name : rust toolchain
26+ uses : actions-rs/toolchain@v1
27+ with :
28+ components : rustfmt, clippy
29+ toolchain : stable
30+ default : true
31+ - name : rust lint
32+ run : |
33+ cd bindings/rust
34+ ./cargo check --no-default-features
35+ ./cargo fmt -- --check
2336
2437 test :
2538 runs-on : ubuntu-20.04
@@ -28,10 +41,17 @@ jobs:
2841 BUILD_TYPE : [Debug, Release]
2942 steps :
3043 - uses : actions/checkout@v2
44+ with :
45+ fetch-depth : 0
3146 - name : deps
3247 run : |
3348 sudo apt-get install -y $APT_DEPS
3449 sudo pip3 install --system $PIP_DEPS
50+ - name : rust toolchain
51+ uses : actions-rs/toolchain@v1
52+ with :
53+ toolchain : stable
54+ default : true
3555 - name : build
3656 run : cmake -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -B build . && cmake --build build -j $(nproc)
3757 - name : test
4161 runs-on : ubuntu-20.04
4262 steps :
4363 - uses : actions/checkout@v2
64+ with :
65+ fetch-depth : 0
4466 - name : build loaders
4567 run : |
4668 sudo apt-get install -y $APT_DEPS
5577 docker run genomicsqlite ldd -v -r build/libgenomicsqlite.so
5678 echo "----"
5779 ldd -v -r build/libgenomicsqlite.so
80+ - name : rust toolchain
81+ uses : actions-rs/toolchain@v1
82+ with :
83+ toolchain : stable
84+ default : true
5885 - name : test portable .so
5986 run : env -C build ctest -V
87+ - name : test rust crate
88+ run : |
89+ set -e
90+ cp build/libgenomicsqlite.so bindings/rust
91+ bindings/rust/cargo test --release
92+ bindings/rust/cargo package --list | grep libgenomicsqlite.so
6093 - name : prepare artifacts
6194 run : cp build/libgenomicsqlite.so include/genomicsqlite.h .
6295 - uses : actions/upload-artifact@v2
@@ -68,30 +101,48 @@ jobs:
68101 runs-on : macOS-10.15
69102 steps :
70103 - uses : actions/checkout@v2
104+ with :
105+ fetch-depth : 0
71106 - name : dependencies
72107 run : |
73108 brew update
74109 brew upgrade
75110 brew install $BREW_DEPS
76111 /usr/local/bin/pip3 install $PIP_DEPS
112+ - name : rust toolchain
113+ uses : actions-rs/toolchain@v1
114+ with :
115+ toolchain : stable
116+ default : true
117+ - name : build environment
118+ run : |
119+ echo "PREFIX=$(brew --prefix)" >> $GITHUB_ENV
120+ echo "PATH=${PREFIX}/opt/python/libexec/bin:${PREFIX}/opt/sqlite/bin:${PATH}" >> $GITHUB_ENV
121+ echo "CFLAGS=-I$(brew --prefix)/include -I$(brew --prefix)/opt/sqlite/include -march=sandybridge" >> $GITHUB_ENV
122+ echo "CXXFLAGS=-I$(brew --prefix)/include -march=sandybridge" >> $GITHUB_ENV
123+ echo "LDFLAGS=-L$(brew --prefix)/lib -L$(brew --prefix)/opt/sqlite/lib" >> $GITHUB_ENV
124+ # used by rusqlite:
125+ echo "SQLITE3_INCLUDE_DIR=$(brew --prefix)/opt/sqlite/include" >> $GITHUB_ENV
126+ echo "SQLITE3_LIB_DIR=$(brew --prefix)/opt/sqlite/lib" >> $GITHUB_ENV
77127 - name : build
78128 run : |
79- CFLAGS="-I$(brew --prefix)/include -I$(brew --prefix)/opt/sqlite/include -march=sandybridge" \
80- CXXFLAGS="-I$(brew --prefix)/include -march=sandybridge" \
81- LDFLAGS="-L$(brew --prefix)/lib -L$(brew --prefix)/opt/sqlite/lib" \
82- cmake -DCMAKE_BUILD_TYPE=Release \
83- -DCMAKE_PREFIX_PATH=$(brew --prefix)/opt/sqlite \
84- -B build .
129+ cmake -DCMAKE_BUILD_TYPE=Release \
130+ -DCMAKE_PREFIX_PATH=$(brew --prefix)/opt/sqlite \
131+ -B build .
85132 cmake --build build -j 4
86133 - name : otool
87134 run : otool -L build/libgenomicsqlite.dylib
88135 - name : ctest
89136 run : |
90- export PREFIX=$(brew --prefix)
91- export PATH=${PREFIX}/opt/python/libexec/bin:${PREFIX}/opt/sqlite/bin:$PATH
92137 cd build
93138 otool -L test/capi_smoke_test
94139 ctest -V
140+ - name : test rust crate
141+ run : |
142+ set -e
143+ cp build/libgenomicsqlite.dylib bindings/rust
144+ bindings/rust/cargo test --release
145+ bindings/rust/cargo package --list | grep libgenomicsqlite.dylib
95146 - name : prepare artifacts
96147 run : cp build/libgenomicsqlite.dylib include/genomicsqlite.h .
97148 - uses : actions/upload-artifact@v2
@@ -115,7 +166,6 @@ jobs:
115166 - name : detect GIT_REVISION
116167 run : |
117168 cp include/genomicsqlite.h .
118- git fetch origin --tags
119169 echo "GIT_REVISION=$(git describe --tags --always)" >> $GITHUB_ENV
120170 - uses : actions/upload-artifact@v2
121171 with :
0 commit comments