Skip to content

Commit c454c0f

Browse files
committed
Add CI Workflow, Add prelim environment.yml
1 parent ad64c49 commit c454c0f

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed

.github/workflows/ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '**'
9+
pull_request:
10+
11+
env:
12+
MPLBACKEND: Agg
13+
PYTEST_ADDOPTS: --color=yes
14+
GITHUB_PR_NUMBER: ${{ github.event.number }}
15+
16+
jobs:
17+
tests:
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
matrix:
21+
include:
22+
- os: ubuntu-latest
23+
python-version: "3.10"
24+
install-method: mamba
25+
26+
- os: ubuntu-latest
27+
python-version: "3.11"
28+
install-method: mamba
29+
extra-args: ["codecov"]
30+
31+
defaults:
32+
run:
33+
# We need login shells (-l) for micromamba to work.
34+
shell: bash -leo pipefail {0}
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 0
40+
41+
- name: Prepare mamba installation
42+
if: matrix.install-method == 'mamba' && contains(github.event.pull_request.labels.*.name, 'documentation-only') == false
43+
env:
44+
PYTHON_VERSION: ${{ matrix.python-version }}
45+
run: |
46+
# setup correct python version
47+
sed -i -e "s/- python.*/- python=$PYTHON_VERSION/g" environment.yml
48+
49+
- name: mamba setup
50+
if: matrix.install-method == 'mamba' && contains(github.event.pull_request.labels.*.name, 'documentation-only') == false
51+
uses: mamba-org/setup-micromamba@v1
52+
with:
53+
environment-file: environment.yml
54+
cache-downloads: true
55+
56+
- name: Install dependencies
57+
env:
58+
PYTHON_VERSION: ${{ matrix.python-version }}
59+
run: |
60+
python --version
61+
pip install pytest-cov restructuredtext-lint pytest-xdist 'coverage!=6.3.0'
62+
pip install -e .[all]
63+
pip freeze
64+
pip list
65+
66+
- name: List installed package versions (conda)
67+
if: matrix.environment-type == 'mamba'
68+
run: micromamba list
69+
70+
- name: Initialize CASAData
71+
run: |
72+
mkdir -p ~/.casa/data/
73+
python -c "import casatools;"
74+
75+
- name: Tests
76+
run: |
77+
pytest -vv --cov --cov-branch --cov-report=xml
78+
79+
- name: Upload coverage to Codecov
80+
uses: codecov/codecov-action@v5
81+
env:
82+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

environment.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: pyvisgrid
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.10
6+
- pip

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dependencies = [
4242
"torch",
4343
"tqdm",
4444
"casatools",
45+
"pyvisgen@git+https://github.com/radionets-project/pyvisgen#egg=main",
4546
]
4647

4748
[project.optional-dependencies]

0 commit comments

Comments
 (0)