Skip to content

Commit cd72a43

Browse files
[CLEANUP] Update workflows and environment (#69)
* Cleanup - update workflows and environment * Update readme and coding conventions docs * Linting * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 330c806 commit cd72a43

14 files changed

Lines changed: 668 additions & 231 deletions

.claude/settings.local.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(find:*)"
5+
],
6+
"deny": [],
7+
"ask": []
8+
}
9+
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Please describe your changes clearly and concisely.
2525

2626
**Checklist:**
2727

28-
- [ ] I have followed the [coding conventions](https://amoccommunity.github.io/amocarray/conventions.html).
28+
- [ ] I have followed the [coding conventions](docs/source/conventions.md).
2929
- [ ] I have updated or added tests to cover my changes.
3030
- [ ] I have updated the documentation if needed.
3131
- [ ] I have run `pytest` to check that all tests pass.

.github/workflows/docs.yml

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,43 @@ on:
66
- '**.py'
77
- '**.ipynb'
88
- '**.rst'
9+
- '**.md'
910

1011
jobs:
1112
build-docs:
1213
runs-on: ubuntu-latest
1314
permissions:
14-
contents: write
15+
contents: read
1516

1617
steps:
17-
- name: checkout
18-
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
2122

22-
- name: Setup Micromamba ${{ matrix.python-version }}
23-
uses: mamba-org/setup-micromamba@v2.0.1
24-
with:
25-
environment-name: TEST
26-
init-shell: bash
27-
create-args: >-
28-
python=3 pip
29-
--file requirements-dev.txt
30-
--channel conda-forge
23+
- name: Setup Micromamba
24+
uses: mamba-org/setup-micromamba@v2
25+
with:
26+
environment-file: environment.yml
27+
init-shell: bash
28+
condarc: |
29+
channels:
30+
- conda-forge
31+
channel_priority: strict
32+
cache-environment: true
3133

32-
- name: Install seagliderOG1
33-
shell: bash -l {0}
34-
run: |
35-
python -m pip install -e . --no-deps --force-reinstall
34+
- name: Install package (editable)
35+
shell: bash -l {0}
36+
run: |
37+
micromamba run -n TEST python -m pip install --upgrade pip
38+
micromamba run -n TEST python -m pip install -e . --no-deps --force-reinstall
3639
37-
- name: Build documentation
38-
shell: bash -l {0}
39-
run: |
40-
set -e
41-
jupyter nbconvert --to notebook --execute notebooks/demo.ipynb --output=demo-output.ipynb --ExecutePreprocessor.allow_errors=True
42-
mv notebooks/*output.ipynb docs/source/
43-
pushd docs
44-
make clean html
45-
popd
40+
- name: Build documentation
41+
shell: bash -l {0}
42+
run: |
43+
set -e
44+
micromamba run -n TEST jupyter nbconvert --to notebook --execute notebooks/demo.ipynb --output=demo-output.ipynb --ExecutePreprocessor.allow_errors=True
45+
mv notebooks/*output.ipynb docs/source/
46+
pushd docs
47+
micromamba run -n TEST make clean html
48+
popd

.github/workflows/docs_deploy.yml

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,50 @@ on:
44
push:
55
branches:
66
- main
7+
# Optional: manual trigger
8+
workflow_dispatch:
79

810
jobs:
9-
build-docs:
11+
deploy-docs:
1012
runs-on: ubuntu-latest
1113
permissions:
1214
contents: write
1315

1416
steps:
15-
- name: Run a one-line script
16-
run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
17-
- name: checkout
18-
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
2121

22-
- name: Setup Micromamba ${{ matrix.python-version }}
23-
uses: mamba-org/setup-micromamba@v2.0.1
24-
with:
25-
environment-name: TEST
26-
init-shell: bash
27-
create-args: >-
28-
python=3 pip
29-
--file requirements-dev.txt
30-
--channel conda-forge
22+
- name: Setup Micromamba
23+
uses: mamba-org/setup-micromamba@v2
24+
with:
25+
environment-file: environment.yml
26+
init-shell: bash
27+
condarc: |
28+
channels:
29+
- conda-forge
30+
channel_priority: strict
31+
cache-environment: true
3132

32-
- name: Install seagliderOG1
33-
shell: bash -l {0}
34-
run: |
35-
python -m pip install -e . --no-deps --force-reinstall
33+
- name: Install package (editable)
34+
shell: bash -l {0}
35+
run: |
36+
micromamba run -n TEST python -m pip install --upgrade pip
37+
micromamba run -n TEST python -m pip install -e . --no-deps --force-reinstall
3638
37-
- name: Build documentation
38-
shell: bash -l {0}
39-
run: |
40-
set -e
41-
jupyter nbconvert --to notebook --execute notebooks/demo.ipynb --output=demo-output.ipynb --ExecutePreprocessor.allow_errors=True
42-
mv notebooks/*output.ipynb docs/source/
43-
pushd docs
44-
make clean html
45-
popd
39+
- name: Build documentation
40+
shell: bash -l {0}
41+
run: |
42+
set -e
43+
micromamba run -n TEST jupyter nbconvert --to notebook --execute notebooks/demo.ipynb --output=demo-output.ipynb --ExecutePreprocessor.allow_errors=True
44+
mv notebooks/*output.ipynb docs/source/
45+
pushd docs
46+
micromamba run -n TEST make clean html
47+
popd
4648
47-
- name: Deploy
48-
uses: peaceiris/actions-gh-pages@v4
49-
with:
50-
github_token: ${{ secrets.GITHUB_TOKEN }}
51-
publish_dir: docs/build/html
49+
- name: Deploy to GitHub Pages
50+
uses: peaceiris/actions-gh-pages@v4
51+
with:
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
publish_dir: docs/build/html

.github/workflows/tests.yml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,45 @@ on:
1515
- '**.ipynb'
1616

1717
jobs:
18-
job_mytests:
18+
test:
1919
runs-on: ${{ matrix.os }}
2020
strategy:
2121
matrix:
2222
os: [ubuntu-latest, windows-latest, macos-latest]
2323
python-version: ["3.10", "3.12"]
2424
fail-fast: true
25-
defaults:
26-
run:
27-
shell: bash -l {0}
28-
steps:
29-
- name: Run a one-line script
30-
run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
31-
- uses: actions/checkout@v4
3225

33-
- name: Setup Micromamba Python ${{ matrix.python-version }}
34-
uses: mamba-org/setup-micromamba@v2
35-
with:
36-
environment-name: TEST
37-
init-shell: bash
38-
create-args: >-
39-
python=${{ matrix.python-version }} --file requirements-dev.txt --channel conda-forge
40-
env:
41-
MAMBA_NO_BANNER: true
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
4229

43-
- name: Check Package Installation
44-
run: |
45-
micromamba env list
46-
micromamba list
47-
python -m pip check
30+
- name: Setup Micromamba
31+
uses: mamba-org/setup-micromamba@v2
32+
with:
33+
environment-file: environment.yml
34+
init-shell: bash
35+
condarc: |
36+
channels:
37+
- conda-forge
38+
channel_priority: strict
39+
cache-environment: true
40+
create-args: >-
41+
python=${{ matrix.python-version }}
4842
43+
- name: Check Package Installation
44+
shell: bash -l {0}
45+
run: |
46+
micromamba run -n TEST micromamba env list
47+
micromamba run -n TEST micromamba list
48+
micromamba run -n TEST python -m pip check
4949
50-
- name: Install seagliderOG1
51-
run: |
52-
python -m pip install -e . --no-deps --force-reinstall
50+
- name: Install package (editable)
51+
shell: bash -l {0}
52+
run: |
53+
micromamba run -n TEST python -m pip install --upgrade pip
54+
micromamba run -n TEST python -m pip install -e . --no-deps --force-reinstall
5355
54-
- name: Full Tests
55-
run: |
56-
python -m pytest --cov=seagliderOG1 --cov-report term-missing tests/
56+
- name: Run tests
57+
shell: bash -l {0}
58+
run: |
59+
micromamba run -n TEST python -m pytest --cov=seagliderOG1 --cov-report term-missing tests/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,4 @@ de421.bsp
172172

173173
# Claude Code files
174174
CLAUDE.md
175+
.claude/*.json

0 commit comments

Comments
 (0)