summaryrefslogtreecommitdiff
path: root/.github/workflows/build-api.yml
blob: e863ba055121197f76fc6ef25047669c4b186770 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build API

on:
  pull_request:
    branches: [master]

defaults:
  run:
    working-directory: opendc-web/opendc-web-api

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        python: [3.8]
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python }}
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
      - name: Lint with pylint
        run: ./check.sh
      - name: Test with pytest
        run: pytest --cov=opendc/ --junitxml=.junit-report.xml
      - name: Publish report
        if: always()
        uses: mikepenz/action-junit-report@v2
        with:
          check_name: test (Python ${{ matrix.python }})
          report_paths: '**/.junit-report.xml'
          github_token: ${{ secrets.GITHUB_TOKEN }}
      - name: Upload code coverage
        uses: codecov/codecov-action@v1
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: opendc-web/opendc-web-api/.coverage
          flags: api