Skip to content

Commit

Permalink
Setup Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dseomn committed Sep 23, 2023
1 parent f8d0b14 commit 5b274a3
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
absl-py
cachecontrol
immutabledict
protobuf
requests
setuptools
setuptools-protobuf
urllib3

0 comments on commit 5b274a3

Please sign in to comment.