diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..a2d1ca5e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: Python CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install dependencies + run: | + sudo apt-get install -qq phyml + pip install --upgrade pip setuptools wheel + pip install --only-binary=numpy,scipy numpy scipy + pip install matplotlib ipython jupyter sympy pytest codecov pytest-cov + pip install -r requirements.txt + pip install . + + - name: Run tests + run: pytest --cov-report=xml --cov=OrthoEvol tests/ + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + fail_ci_if_error: true + + - name: Notify failure + if: failure() + run: echo "Build failed"