Skip to content

Commit

Permalink
Merge pull request #144 from davidatbu/feature/try-setting-up-CI
Browse files Browse the repository at this point in the history
Create main.yml for continuous integration
  • Loading branch information
dnaaun authored Jul 4, 2020
2 parents 43197c7 + 3178753 commit e13df3d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This is a basic workflow to help you get started with Actions

name: unittest-CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
unittest:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Install Redis
run: sudo apt-get install redis

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Cd into checked out copy
run: cd $GITHUB_WORKSPACE

- name: Download and extract mallet
run: |
wget http://mallet.cs.umass.edu/dist/mallet-2.0.8.tar.gz -O $HOME/mallet-2.0.8.tar.gz
mkdir $HOME/mallet
tar -xvf ~/mallet-2.0.8.tar.gz --one-top-level=$HOME/mallet
- name: Install Python libraries
run: python -m pip install -r backend/requirements_no_gpu.txt

- name: Download nltk resources
run: python -m nltk.downloader stopwords wordnet

- name: Set the MALLET_BIN_DIRECTORY env variable
run: echo ::set-env name=MALLET_BIN_DIRECTORY::$HOME/mallet/mallet-2.0.8/bin

- name: Run unittesting
run: python -m unittest
working-directory: backend/
2 changes: 0 additions & 2 deletions backend/tests/test_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from unittest import mock

from tests.common import AppMixin
from tests.common import debug_on
from tests.common import make_csv_file
from tests.common import TESTING_FILES_DIR

Expand Down Expand Up @@ -107,7 +106,6 @@ def test_trigger_training(self) -> None:
self.assertTrue(dev_set_file.exists())
self.assertTrue(train_set_file.exists())

@debug_on()
def test_training_and_testing(self) -> None:
with self.subTest("training classifier"):
with self._app.app_context():
Expand Down
2 changes: 0 additions & 2 deletions backend/tests/test_topic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import pandas as pd # type: ignore
from tests.common import AppMixin
from tests.common import debug_on # noqa:
from tests.common import make_csv_file
from tests.common import TESTING_FILES_DIR

Expand Down Expand Up @@ -178,7 +177,6 @@ def test_post(self) -> None:
fname_topics_by_doc=str(fname_topics_by_doc),
)

@debug_on()
def test_training(self) -> None:

with self._app.app_context():
Expand Down

0 comments on commit e13df3d

Please sign in to comment.