don't save empty stats #110
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: Test | |
on: [push, pull_request] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
# Checkout the repository, making sure we recursively get the git submodules which contain our dependencies | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
# Install dependencies (currently, only boost, the rest is in submodules) | |
- name: Install Dependencies | |
run: sudo apt -qq install -y libboost-all-dev | |
- name: Configure CMake | |
# Configure CMake in a 'build' subdirectory, using the build type as set up | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
# Ideally, we would like to specify --parallel as a built option, but this leads to sporadic OOM kills | |
# that cause the jobs to fail. In any case, due to LTO a large fraction of built time is consumed by linkin | |
# | |
- name: Building | |
# Build the train and predict executables with the given settings | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Upload unit test file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: ${{github.workspace}}/build/bin/ | |
unit-tests: | |
needs: build | |
runs-on: ubuntu-22.04 | |
steps: | |
# Checkout the repository. We are not planning on building anything, so no need to get the dependencies recursively. | |
- uses: actions/checkout@v3 | |
- name: Download built test binary | |
uses: actions/download-artifact@v3 | |
with: | |
name: binaries | |
- name: Set execute permissions | |
run: | | |
sudo chmod a+x unittest | |
ls -la | |
- name: Running Unit Tests | |
run: ./unittest | |
eurlex-test: | |
needs: build | |
runs-on: ubuntu-22.04 | |
# set up the DISMEC_BIN_DIR variable so that the test scripts can find the executables | |
env: | |
DISMEC_BIN_DIR: ${{github.workspace}} | |
steps: | |
# Checkout the repository. We are not planning on building anything, so no need to get the dependencies recursively. | |
- uses: actions/checkout@v3 | |
- name: Download built test binary | |
uses: actions/download-artifact@v3 | |
with: | |
name: binaries | |
- name: Set execute permissions | |
run: | | |
sudo chmod a+x train predict | |
ls -la | |
- name: Training on Eurlex | |
run: ./train test/tfidf-eurlex-train.txt eurlex.model --augment-for-bias --normalize-instances --save-sparse-txt --weight-culling=0.01 | |
- name: Prediction on Eurlex | |
run: ./predict test/tfidf-eurlex-test.txt eurlex.model eurlex_pred.txt --augment-for-bias --normalize-instances --topk=5 | |
# Setting up python to run the pytest script | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install python dependencies | |
run: pip install pytest numpy | |
- name: Verify eurlex training | |
working-directory: test | |
run: pytest eurlex-test.py |