Skip to content

Commit

Permalink
Bring in Circle CI (#141)
Browse files Browse the repository at this point in the history
* Add .circleci/config.yml

* Leave out the coverage report

* allow sudo to carry user set env var

* add pip missing packages

* a working version build and test workflow

* empty line

* Just to trigger new build

* integration with coveralls
  • Loading branch information
jiashenC committed Feb 21, 2021
1 parent a9f2b28 commit 2abeba0
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: 2.1

jobs:
build-and-test:
machine:
image: ubuntu-1604:202007-01
steps:
- checkout

- run:
name: Before Install
command: |
sh script/install/before_install.sh
environment:
DEBIAN_FRONTEND: noninteractive

- run:
name: Install
command: |
export PATH="$HOME/miniconda/bin:$PATH"
sh script/install/install.sh
# allow no-password connection for root
sudo mysql -u root -e "SELECT User,Host FROM mysql.user;
DROP USER 'root'@'localhost';
CREATE USER 'root'@'%' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;"
- run:
name: Test
command: |
export PATH="$HOME/miniconda/bin:$PATH"
conda init bash
source ~/.bashrc
conda activate eva
sh script/test/test.sh
coveralls
workflows:
main:
jobs:
- build-and-test
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
repo_token: oy7xYr3RiDFGCpsaMhfL2cqmh61XtaEKZ
service_name: circle-ci
6 changes: 3 additions & 3 deletions script/install/before_install.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh

# Install mysql and start server
sudo apt-get update
sudo apt-get install mysql-server
sudo -E apt-get update
sudo -E apt-get -q -y install mysql-server
sudo systemctl start mysql

# Install java8 (for running antlr4)
sudo apt install openjdk-8-jdk openjdk-8-jre
sudo -E apt install -y openjdk-8-jdk openjdk-8-jre

# Install conda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
Expand Down
3 changes: 3 additions & 0 deletions script/install/conda_eva_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ dependencies:
- antlr4-python3-runtime==4.8
- petastorm
- pre-commit
- flake8
- pytest
- coveralls
prefix: eva

0 comments on commit 2abeba0

Please sign in to comment.