Run pytype #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2023 Google LLC | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
on: | |
push: {} | |
schedule: | |
- cron: '27 22 * * 4' | |
jobs: | |
test: | |
strategy: | |
matrix: | |
python-version: | |
- '3.10' | |
- '3.11' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install system dependencies | |
run: | | |
# TODO(dseomn): Install protobuf-compiler from the system repos once the | |
# version there is new enough to work with the version of protobuf from | |
# pypi: https://protobuf.dev/news/2022-05-06/#python-updates | |
curl \ | |
--location \ | |
-o protoc.zip \ | |
https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip | |
sudo unzip protoc.zip -d /usr/local | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build | |
run: | | |
python setup.py build | |
- name: Check formatting | |
run: | | |
pip install black | |
black --check --diff . | |
- name: Check types | |
# TODO(https://github.com/google/pytype/issues/1308): Remove condition. | |
if: matrix.python-version != '3.11' | |
run: | | |
pip install pytype | |
pytype | |
- name: Test | |
run: | | |
pip install pytest pytest-cov | |
pytest |