File: presubmit-python.yml

package info (click to toggle)
glome 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 716 kB
  • sloc: ansic: 2,468; python: 508; sh: 149; makefile: 20
file content (48 lines) | stat: -rw-r--r-- 1,262 bytes parent folder | download | duplicates (2)
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
46
47
48
name: python-presubmit
on:
  push:
    branches: ['master']
  pull_request:
    paths: ['python/**', '.github/workflows/presubmit-python.yml']
  workflow_dispatch: {}

defaults:
  run:
    working-directory: python

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: yapf
        run: |
          python -m pip install --upgrade yapf
          find . -type f -name '*.py' -print0 | \
            xargs -0 --verbose yapf -d --style google
      - name: pylint
        # pylint checks only pyglome/*
        run: |
          python -m pip install --upgrade pylint
          find pyglome -type f -name '*.py' -print0 | \
            xargs -0 --verbose pylint

  unit-test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python-version: ["3.9", "3.10", "3.11", "3.12"]

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
      - name: Run tests
        run: python -m test