pr-checks.yaml 1.47 KB
Newer Older
Eric Ma's avatar
Eric Ma committed
1
2
3
4
# Tests that run on every PR

name: Pull Request Checks

Alok Saldanha's avatar
Alok Saldanha committed
5
on: [push, pull_request]
Eric Ma's avatar
Eric Ma committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

jobs:
  black:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
        name: Checkout repository

      - uses: actions/setup-python@v2
        name: Setup Python
        with:
          python-version: 3.9

      - name: Install black
        run: |
          python -m pip install --upgrade pip
          pip install black
      - name: Run black
        run: |
Alok Saldanha's avatar
Alok Saldanha committed
25
          black . --check
Eric Ma's avatar
Eric Ma committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  # This job is copied over from `deploy.yaml`
  run-tests:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2

      # See: https://github.com/marketplace/actions/setup-conda
      - uses: s-weigand/setup-conda@v1
        with:
          conda-channels: "conda-forge"

      - name: Build environment
        run: |
          conda env create -f environment.yml
Alok Saldanha's avatar
Alok Saldanha committed
40
          eval "$(conda shell.bash hook)"
Eric Ma's avatar
Eric Ma committed
41
42
43
44
45
          conda activate cellxgene-gateway
          python setup.py install

      - name: Run tests
        run: |
Alok Saldanha's avatar
Alok Saldanha committed
46
          eval "$(conda shell.bash hook)"
Eric Ma's avatar
Eric Ma committed
47
          conda activate cellxgene-gateway
48
49
50
51
52
53
54
55
56
57
58
59
60
          coverage run -m unittest discover tests

      - name: Check coverage
        run: |
          eval "$(conda shell.bash hook)"
          conda activate cellxgene-gateway
          coverage report --fail-under 41
          coverage xml -i

      - name: "Upload coverage to Codecov"
        uses: codecov/codecov-action@v1
        with:
          fail_ci_if_error: true