Skip to content

Commit e9ea27a

Browse files
Adding continuous integration.
1 parent 235fc66 commit e9ea27a

File tree

10 files changed

+121
-0
lines changed

10 files changed

+121
-0
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
9+
# Maintain dependencies for Composer
10+
- package-ecosystem: "pip"
11+
directory: "/"
12+
schedule:
13+
interval: "monthly"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Style, Spellcheck, & Docstring
2+
3+
on: pull_request
4+
5+
jobs:
6+
style:
7+
name: Style
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
python-version: "3.11"
13+
- uses: pre-commit/[email protected]
14+
- name: Install dependencies
15+
run: pip install .
16+
# Run Ruff
17+
- name: Run Ruff
18+
run: ruff check contourusv
19+
# Run Codespell
20+
- name: Run Codespell
21+
run: codespell contourusv

.github/workflows/pypi.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# release workflow
2+
name: Release workflow
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
pypi-publish:
10+
name: Upload release to PyPI
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/contourusv
15+
permissions:
16+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
17+
steps:
18+
# retrieve your distributions here
19+
- uses: actions/checkout@v4
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.x"
24+
- name: Install pypa/build
25+
run: >-
26+
python -m
27+
pip install
28+
build
29+
--user
30+
- name: Build a binary wheel and a source tarball
31+
run: >-
32+
python -m
33+
build
34+
--sdist
35+
--wheel
36+
--outdir dist/
37+
.
38+
- name: Publish package distributions to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
matrix:
17+
os:
18+
- ubuntu-latest
19+
- macos-latest # arm64 (Apple Silicon)
20+
- macos-13 # latest Intel release
21+
- windows-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python 3.9
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.9"
29+
- name: Force numpy < 2 on MacOS Intel
30+
if: matrix.os == 'macos-13'
31+
run: pip install 'numpy<2'
32+
- name: Install ContourUSV
33+
run: pip install -e .
34+
- name: Test import
35+
run: |
36+
python -c "import contourusv"
37+
#- name: Install testing dependencies
38+
# run: pip install -r requirements_testing.txt
39+
#- name: Install QC depedencies
40+
# run: pip install -r requirements_qc.txt
41+
- name: Test
42+
run: |
43+
coverage run -m pytest
44+
- name: Upload coverage to codecov (Only do this for the ubuntu-latest job)
45+
if: matrix.os == 'ubuntu-latest'
46+
uses: codecov/codecov-action@v5
47+
with:
48+
token: ${{secrets.CODECOV_TOKEN}}

contourusv/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)