overwrite problematic deps (#236) #222
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux Tests | |
on: | |
push: | |
branches: [ master ] | |
tags: ['v*'] | |
pull_request: | |
branches: [ master ] | |
release: | |
types: [published] | |
jobs: | |
build_and_test: | |
if: "github.repository == 'libamtrack/library' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" | |
name: Compile and test library | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install necessary packages | |
run: sudo apt-get -y install libgsl-dev | |
- name: compile and install | |
run: | | |
mkdir build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Release ../ -DCMAKE_INSTALL_PREFIX=$HOME/usr | |
cmake --build . --target install -- -j | |
- name: tests | |
run: | | |
LD_LIBRARY_PATH=$HOME/usr/lib $HOME/usr/bin/amtrack_test | |
LD_LIBRARY_PATH=$HOME/usr/lib $HOME/usr/bin/amtrack_demo | |
javascript_package: | |
if: "github.repository == 'libamtrack/library' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: ubuntu-latest | |
needs: [build_and_test] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mymindstorm/setup-emsdk@v12 | |
- name: Cache compiled GSL | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: $HOME/usr | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/main.yml') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Compile GSL | |
run: | | |
wget -q "http://ftpmirror.gnu.org/gnu/gsl/gsl-latest.tar.gz" | |
mkdir $HOME/gsl-latest | |
tar -xzf gsl-latest.tar.gz -C $HOME/gsl-latest | |
mv $HOME/gsl-latest/** $HOME/gsl-latest/gsl | |
mkdir $HOME/usr | |
cd $HOME/gsl-latest/gsl/ && emconfigure ./configure --prefix=$HOME/usr --disable-shared && emmake make -j && emmake make install | |
ls -al $HOME/usr/lib/ | |
- name: Compile libamtrack webassembly package | |
run: | | |
GSL_INCLUDE_DIRS=$HOME/usr/include GSL_LIBRARY=$HOME/usr/lib/libgsl.a GSL_CBLAS_LIBRARY=$HOME/usr/lib/libgslcblas.a ./compile_to_js.sh | |
working-directory: distributions/JavaScript | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wasm file | |
path: | | |
distributions/JavaScript/output/libat.wasm | |
distributions/JavaScript/output/libat.js | |
if-no-files-found: error | |
retention-days: 5 | |
python_package: | |
if: "github.repository == 'libamtrack/library' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" | |
name: Make and test python bindings | |
runs-on: ubuntu-latest | |
needs: [build_and_test] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Number of commits to fetch. 0 indicates all history for all branches and tags. | |
# Default: 1 | |
fetch-depth: '0' | |
- name: make python package | |
run: sudo ./make_wheel_package.sh | |
working-directory: distributions/Python/pyamtrack | |
- name: test python package | |
run: sudo ./test_wheel_package.sh | |
working-directory: distributions/Python/pyamtrack | |
- name: check generated files | |
run: ls -alh distributions/Python/pyamtrack/generated/dist/wheelhouse/ | |
- name: publish package to pypi | |
uses: pypa/gh-action-pypi-publish@v1.8.14 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
with: | |
password: ${{ secrets.TWINE_PASSWORD }} | |
repository_url: "https://upload.pypi.org/legacy/" | |
packages_dir: distributions/Python/pyamtrack/generated/dist/wheelhouse/ | |
verbose: true | |
r_package: | |
if: "github.repository == 'libamtrack/library' && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: ubuntu-latest | |
needs: [build_and_test] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: install deps | |
run: | | |
sudo apt-get install -y r-base-core libgsl-dev | |
pip install -r distributions/R/generator/requirements.txt | |
pip install "robotpy-cppheaderparser==5.1.1" | |
- name: make R package source | |
run: | | |
python generator/scripts/header_parser.py --namespace ./NAMESPACE --out-dir ./out/ libamtrack "../../include/*.h" | |
python generator/scripts/prepare.py --desc-path ./DESCRIPTION --version 0.12.0 --out-dir ./out ../../include ../../src | |
working-directory: distributions/R | |
- name: install R deps | |
run: | | |
sudo R --vanilla -e 'install.packages("roxygen2", repos="http://cran.us.r-project.org")' | |
sudo R --vanilla -e 'install.packages("pkgbuild", repos="http://cran.us.r-project.org")' | |
- name: install R binary package | |
run: | | |
R --vanilla -e 'setwd("out"); roxygen2::roxygenise(load_code = "source")' | |
R --vanilla -e 'setwd("out"); pkgbuild::build(binary = TRUE, needs_compilation = TRUE)' | |
working-directory: distributions/R | |
- name: test R binary package | |
run: | | |
sudo R --vanilla -e 'install.packages("libamtrack_0.12.0_R_x86_64-pc-linux-gnu.tar.gz")' | |
R --vanilla -e 'library(libamtrack); AT.beta.from.E.single(60)' | |
working-directory: distributions/R | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: R package | |
path: distributions/R/libamtrack_0.12.0_R_x86_64-pc-linux-gnu.tar.gz | |
if-no-files-found: error | |
retention-days: 5 |