Skip to content

Commit

Permalink
chore: Create tests.yml (#183)
Browse files Browse the repository at this point in the history
Convert from CircleCI to Github Actions
  • Loading branch information
software-dov committed Feb 9, 2021
1 parent 6a43682 commit 2dee6fc
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 297 deletions.
288 changes: 0 additions & 288 deletions .circleci/config.yml

This file was deleted.

12 changes: 3 additions & 9 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ branchProtectionRules:
- pattern: master
isAdminEnforced: true
requiredStatusCheckContexts:
- 'ci/circleci: docs'
- 'ci/circleci: style-check'
- 'ci/circleci: unit-3.6'
- 'ci/circleci: unit-3.7'
- 'ci/circleci: unit-3.8'
- 'ci/circleci: unit-3.9'
- 'ci/circleci: unit-cpp-3.6'
- 'ci/circleci: unit-cpp-3.7'
- 'ci/circleci: unit-cpp-3.8'
- 'style-check'
- 'docs'
- 'unit'
- 'cla/google'
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Tests

# Controls when the action will run.
on:
pull_request:
push:
branches: [ $default-branch ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
style-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install black
run: pip install black==19.10b0
- name: Check diff
run: black --diff --check .
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install nox.
run: python -m pip install nox
- name: Build the documentation.
run: nox -s docs
unit:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.6, 3.7, 3.8, 3.9]
variant: ['', cpp]
# Note: as of 2021-02-09, there are no 3.9 python wheels for protobuf/grpc
exclude:
- python: 3.9
variant: cpp
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install nox and codecov.
run: |
pip install nox
pip install codecov
- name: Run unit tests.
run: nox -s unit${{ matrix.variant }}-${{ matrix.python }}
- name: Submit coverage data to codecov.
run: codecov
if: always()

0 comments on commit 2dee6fc

Please sign in to comment.