Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup ci #4

Merged
merged 13 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Test CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install dependencies
run: |
apt-get update && apt-get install -y make
python -m pip install --upgrade pip
pip install pre-commit

- name: Install pre-commit hooks
run: |
pre-commit install

- name: Run lint
run: |
make lint
build:

runs-on: ubuntu-latest
container:
image: pytorch/pytorch:latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build package
run: |
apt-get update && apt-get install -y build-essential
python -m pip install --upgrade pip
pip install --no-build-isolation .[test]
python setup.py build_ext --inplace
- name: Run tests
run: make unittest
- name: coverage
run: make coverage
50 changes: 0 additions & 50 deletions .github/workflows/dev.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/preview.yml

This file was deleted.

89 changes: 0 additions & 89 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 2 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ lint: license

unittest:
coverage run --source earth2grid/ -m pytest
coverage run --source earth2grid/ -a -m pytest --doctest-modules earth2grid/ -vv
# requires vtk so don't run in ci
# coverage run --source earth2grid/ -a -m pytest --doctest-modules earth2grid/ -vv

coverage:
coverage report
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ dependencies = [
test = [
"pytest>=6.2.4",
"black>=21.5b2",
"coverage>=7.0.0",
"isort>=5.8.0",
"mypy>=0.900",
"flake8>=3.9.2",
"flake8-docstrings>=1.6.0",
"pytest-cov>=2.12.0"
"pytest-cov>=2.12.0",
"pytest-regtest>=1.5.1,<2"
]
dev = [
"tox>=3.20.1",
Expand Down
1 change: 1 addition & 0 deletions tests/test_latlon.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import torch

from earth2grid.latlon import equiangular_lat_lon_grid


Expand Down
Loading