Skip to content

Commit

Permalink
configure CI (#2)
Browse files Browse the repository at this point in the history
* add the main dependencies

* configure a basic CI

* make dependabot auto-update actions versions

* rename the project to `healpix-convolution`
  • Loading branch information
keewis authored May 17, 2024
1 parent 03d83ba commit c509283
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
91 changes: 91 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
paths:
- "ci/**"
- ".github/**"
- "/*" # covers files such as pyproject.toml
- "healpix_indexing/**"
workflow_dispatch: # allows triggering manually

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
detect-ci-trigger:
name: detect ci trigger
runs-on: ubuntu-latest
if: |
github.owner == "iaocea"
&& (github.event_name == "push" || github.event_name == "pull_request")
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: xarray-contrib/ci-trigger@v1
id: detect-trigger
with:
keyword: "[skip-ci]"

test:
name: ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
needs: detect-ci-trigger
if: needs.detect-ci-trigger.outputs.triggered == 'false'
env:
FORCE_COLOR: 3
CONDA_ENV_FILE: "ci/requirements/environment.yaml"
defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/requirements/environment.yaml
environment-name: healpix-convolution-tests
cache-environment: true
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
create-args: >-
python=${{matrix.python-version}}
conda
- name: Install healpix-convolution
run: |
python -m pip install --no-deps -e .
- name: Version info
run: |
conda info -a
conda list
- name: Restore cached hypothesis directory
uses: actions/cache@v4
with:
path: .hypothesis/
key: cache-hypothesis
enableCrossOsArchive: true
save-always: true

- name: Run tests
run: |
python -m pytest --cov=healpix_convolution
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Apache Software License 2.0

Copyright (c) 2024, healpix-indexing developers
Copyright (c) 2024, healpix-convolution developers

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
1 change: 0 additions & 1 deletion ci/requirements/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
name: healpix-indexing-docs
channels:
- conda-forge
dependencies:
Expand Down
9 changes: 8 additions & 1 deletion ci/requirements/environment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
name: healpix-indexing-tests
channels:
- conda-forge
dependencies:
Expand All @@ -7,3 +6,11 @@ dependencies:
- pre-commit
- pytest
- pytest-reportlog
- numba
- numpy
- healpy
- geopandas
- pandas
- xarray
- folium
- shapely
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -- Project information -----------------------------------------------------
import datetime as dt

project = "healpix-indexing"
project = "healpix-convolution"
author = f"{project} developers"
initial_year = "2024"
year = dt.datetime.now().year
Expand All @@ -23,8 +23,8 @@
]

extlinks = {
"issue": ("https://github.com/keewis/healpix-indexing/issues/%s", "GH%s"),
"pull": ("https://github.com/keewis/healpix-indexing/pull/%s", "PR%s"),
"issue": ("https://github.com/iaocea/healpix-convolution/issues/%s", "GH%s"),
"pull": ("https://github.com/iaocea/healpix-convolution/pull/%s", "PR%s"),
}

# Add any paths that contain templates here, relative to this directory.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from importlib.metadata import version

try:
__version__ = version("healpix_indexing")
__version__ = version("healpix_convolution")
except Exception:
__version__ = "9999"
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "healpix-indexing"
name = "healpix-convolution"
requires-python = ">= 3.12"
license = {text = "Apache-2.0"}
dependencies = []
Expand All @@ -10,7 +10,7 @@ requires = ["setuptools>=64.0", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["healpix_indexing"]
packages = ["healpix_convolution"]

[tool.setuptools_scm]
fallback_version = "9999"
Expand Down Expand Up @@ -58,5 +58,5 @@ extend-safe-fixes = [


[tool.ruff.lint.isort]
known-first-party = ["healpix_indexing"]
known-first-party = ["healpix_convolution"]
known-third-party = []

0 comments on commit c509283

Please sign in to comment.