Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added properly working Github Action #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Rust

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install libtorch
run: |
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.1%2Bcpu.zip
unzip libtorch-cxx11-abi-shared-with-deps-2.0.1+cpu.zip
mv libtorch /opt/
shell: bash
- name: Set LIBTORCH environment variable
run: echo "LIBTORCH=/opt/libtorch" >> $GITHUB_ENV
- name: Set LIBTORCH_INCLUDE environment variable
run: echo "LIBTORCH_INCLUDE=/opt/libtorch" >> $GITHUB_ENV
- name: Set LIBTORCH_LIB environment variable
run: echo "LIBTORCH_LIB=/opt/libtorch" >> $GITHUB_ENV
- name: Set LD_LIBRARY_PATH environment variable
run: echo "LD_LIBRARY_PATH=/opt/libtorch/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Build
run: cargo build --verbose

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install libtorch
run: |
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.1%2Bcpu.zip
unzip libtorch-cxx11-abi-shared-with-deps-2.0.1+cpu.zip
mv libtorch /opt/
shell: bash
- name: Set LIBTORCH environment variable
run: echo "LIBTORCH=/opt/libtorch" >> $GITHUB_ENV
- name: Set LIBTORCH_INCLUDE environment variable
run: echo "LIBTORCH_INCLUDE=/opt/libtorch" >> $GITHUB_ENV
- name: Set LIBTORCH_LIB environment variable
run: echo "LIBTORCH_LIB=/opt/libtorch" >> $GITHUB_ENV
- name: Set LD_LIBRARY_PATH environment variable
run: echo "LD_LIBRARY_PATH=/opt/libtorch/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: preparation
run: |
pip3 install -r ./utils/requirements.txt
python3 ./utils/prepare_models.py
- name: Run Tests
run: cargo test --verbose -- --skip test_sbert_encode_attention --skip test_distilroberta_for_classification_rust_tokenizers_sentencepiece --skip test_rust_tokenizers_sentencepiece