-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests CI github action (#1)
* Add unit test CI github action * Update the jobs * update pytype * fix pytype * add core tests * update ci job w tear down handling * rm core unit tests
- Loading branch information
1 parent
e2ca618
commit 78a0b06
Showing
3 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Copyright 2024 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 | ||
# | ||
# http://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. | ||
|
||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Unit Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
schedule: | ||
# Run the job every 12 hours | ||
- cron: '0 */12 * * *' | ||
|
||
jobs: | ||
py: | ||
name: "Python type check" | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
python-version: ['3.10'] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Dependencies | ||
run: | | ||
pip install pytype | ||
pip install -r requirements.txt | ||
- name: Typecheck the code with pytype | ||
run: | | ||
pytype --jobs auto --disable import-error --disable module-attr jetstream/ | ||
cpu: | ||
name: "JetStream unit tests" | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
python-version: ['3.10'] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- name: Test mock JetStream token utils | ||
run: | | ||
python -m jetstream.engine.utils_test | ||
- name: Test mock JetStream engine implementation | ||
run: | | ||
python -m jetstream.engine.mock_engine_test |
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
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