From 0c4592abf94a9a0383a2bc117bc9d0c1b976efaf Mon Sep 17 00:00:00 2001 From: David Mandelberg Date: Fri, 22 Sep 2023 23:12:37 -0400 Subject: [PATCH] Setup Github Actions --- .github/workflows/test.yaml | 57 +++++++++++++++++++++++++++++++++++++ requirements.txt | 10 +++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/workflows/test.yaml create mode 100644 requirements.txt diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..5c96949 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,57 @@ +# 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: Test + run: | + pip install pytest pytest-cov + pytest diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..39f5ac4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,10 @@ +absl-py +cachecontrol +immutabledict +protobuf +python-dateutil +pyyaml +requests +setuptools +setuptools-protobuf +urllib3