|
| 1 | +name: Check ni.protobuf.types |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +jobs: |
| 8 | + check_package: |
| 9 | + name: Check ni.protobuf.types |
| 10 | + runs-on: ubuntu-latest |
| 11 | + defaults: |
| 12 | + run: |
| 13 | + # Set the working-directory for all steps in this job. |
| 14 | + working-directory: ./packages/ni.protobuf.types |
| 15 | + steps: |
| 16 | + - name: Check out repo |
| 17 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 18 | + - name: Set up Python |
| 19 | + uses: ni/python-actions/setup-python@a3bfe1baa6062fd6157683651d653d527967d4d4 # v0.3.1 |
| 20 | + id: setup-python |
| 21 | + - name: Set up Poetry |
| 22 | + uses: ni/python-actions/setup-poetry@a3bfe1baa6062fd6157683651d653d527967d4d4 # v0.3.1 |
| 23 | + - name: Check for lock changes |
| 24 | + run: poetry check --lock |
| 25 | + - name: Cache virtualenv |
| 26 | + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 |
| 27 | + with: |
| 28 | + path: packages/ni.protobuf.types/.venv |
| 29 | + key: ni.protobuf.types-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('packages/ni.protobuf.types/poetry.lock') }} |
| 30 | + - name: Install ni.protobuf.types |
| 31 | + run: poetry install -v |
| 32 | + - name: Lint |
| 33 | + run: poetry run ni-python-styleguide lint |
| 34 | + - name: Mypy static analysis (Linux) |
| 35 | + run: poetry run mypy |
| 36 | + - name: Mypy static analysis (Windows) |
| 37 | + run: poetry run mypy --platform win32 |
| 38 | + - name: Bandit security checks |
| 39 | + run: poetry run bandit -c pyproject.toml -r src/ni/protobuf |
| 40 | + - name: Add virtualenv to the path for pyright-action |
| 41 | + run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH |
| 42 | + - name: Pyright static analysis (Linux) |
| 43 | + uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2 |
| 44 | + with: |
| 45 | + python-platform: Linux |
| 46 | + version: PATH |
| 47 | + working-directory: ./packages/ni.protobuf.types |
| 48 | + - name: Pyright static analysis (Windows) |
| 49 | + uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2 |
| 50 | + with: |
| 51 | + python-platform: Windows |
| 52 | + version: PATH |
| 53 | + working-directory: ./packages/ni.protobuf.types |
0 commit comments