Skip to content

Commit

Permalink
CI: Fix build
Browse files Browse the repository at this point in the history
Change-Id: I79214b1d513cfdba4f34b553e9b3bebcd63ce255
  • Loading branch information
kupietz committed Jun 1, 2024
1 parent 7a57567 commit b3908d0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
16 changes: 3 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include:
local: ci/install-rkorapclient-ci.yml

test-korapclient-on-stable:
test-korapclient-on-latest:
extends: .install-rkorapclient
image: ubuntu:latest
cache:
Expand All @@ -11,18 +11,8 @@ test-korapclient-on-stable:
- ccache/
- rlib/
script:
- python3 -m pip install pip -U
- python3 -m pip install setuptools -U
- python3 -m pip install pytest -U
- mkdir -p ~/.config/pip
- echo -e "[global]\nbreak-system-packages = true" >> ~/.config/pip/pip.conf
- python3 -m pip install .
- python3 -m pytest -v


test-korapclient-on-rolling:
extends: .install-rkorapclient
image: ubuntu:rolling
script:
- python3 -m pip install pip -U --break-system-packages
- python3 -m pip install pytest -U --break-system-packages
- python3 -m pip install . --break-system-packages
- python3 -m pytest -v
7 changes: 6 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,27 @@ Currently, this is no native Python package. Internally, it uses [KorAP's client
via [rpy2](https://rpy2.github.io/). The latter also automatically translates between R data frames (or [tibbles](https://tibble.tidyverse.org/)) and [pandas DataFrames](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html).

## Installation

#### 1. Install latest R version for your OS, following the instructions from [CRAN](https://cran.r-project.org/bin/)

#### Linux only: Install system dependencies

```shell script
#### Debian / Ubuntu
sudo apt install r-base-dev r-cran-rcpp r-cran-cpp11 libcurl4-gnutls-dev libxml2-dev libsodium-dev libsecret-1-dev libfontconfig1-dev libssl-dev libv8-dev python3-dev python3-pip python3-rpy2 python3-pandas python3-pytest
sudo apt install r-base-dev r-cran-rcpp r-cran-cpp11 libcurl4-gnutls-dev libxml2-dev libsodium-dev libsecret-1-dev libfontconfig1-dev libssl-dev libv8-dev python3-dev python3-pip python3-rpy2 python3-pandas python3-pytest libdeflate-dev r-cran-rcpparmadillo

#### Fedora / CentOS / RHEL
sudo yum install -y R R-devel libcurl-devel openssl-devel libxml2-devel libsodium-devel python3-pandas
```

#### 2. Install the RKorAPClient package

Start R and run:

```R
install.packages('RKorAPClient', repos='https://cloud.r-project.org/')
```

or install RKorAPClient from the package installation menu entry.

#### 3. Install the Python package
Expand All @@ -43,6 +47,7 @@ python3 -m pip install KorAPClient -U # --break-system-packages
```

On Windows:

```shell script
# py -m pip install pip -U
py -m pip install KorAPClient -U
Expand Down
4 changes: 2 additions & 2 deletions ci/Makevars
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ VER=
CXX17=$(CCACHE) g++$(VER)
CCACHE=ccache
#CCACHE=
CC=$(CCACHE) gcc$(VER)
CXX=$(CCACHE) g++$(VER)
CC=$(CCACHE) gcc$(VER) -Wno-error=format-security
CXX=$(CCACHE) g++$(VER) -Wno-error=format-security
CXX11=$(CCACHE) g++$(VER)
CXX14=$(CCACHE) g++$(VER)
CXX17=$(CCACHE) g++$(VER)
Expand Down
7 changes: 5 additions & 2 deletions ci/install-rkorapclient-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@
- echo "R_LIBS='$R_LIBS_USER'" > .Renviron
- echo "MAKEFLAGS=-j$(nproc)" >> ~/.R/Makevars
- echo "MAKE=make -j$(nproc)" >> ~/.R/Makevars
- echo "CFLAGS+=-Wno-error=format-security" >> ~/.R/Makevars
- echo "CCFLAGS+=-Wformat=0" >> ~/.R/Makevars
- apt-get update
- apt-get install -y -o dir::cache::archives="$APT_CACHE_DIR" --no-install-recommends software-properties-common dirmngr ccache wget python3-pip
- apt-get install -y -o dir::cache::archives="$APT_CACHE_DIR" --no-install-recommends software-properties-common dirmngr ccache wget python3-pip libdeflate-dev
- wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
- add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
# - add-apt-repository ppa:c2d4u.team/c2d4u4.0+
- add-apt-repository -y ppa:c2d4u.team/c2d4u4.0+
- grep -E "sudo apt.* install" Readme.md | sed -e 's/.*sudo apt.* install/apt-get install --no-install-recommends -o dir::cache::archives="$APT_CACHE_DIR" -y libharfbuzz-dev libfribidi-dev /g' | sh
- apt-get install -y -o dir::cache::archives="$APT_CACHE_DIR" r-cran-tidyverse
- ln -s $(which ccache) /usr/local/sbin/gcc
- ln -s $(which ccache) /usr/local/sbin/g++
- end_section install_linux_packages
Expand Down

0 comments on commit b3908d0

Please sign in to comment.