Skip to content

Commit 7ebf7fe

Browse files
authored
update infra & docs (#497)
1 parent 274fc29 commit 7ebf7fe

12 files changed

Lines changed: 160 additions & 197 deletions

.github/workflows/build_docs.yml

Lines changed: 50 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,50 @@
1-
name: Build Docs
2-
3-
on:
4-
push:
5-
# Sequence of patterns matched against refs/tags
6-
tags:
7-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
8-
workflow_dispatch:
9-
inputs:
10-
version:
11-
description: Manual Doc Build Reason
12-
default: test
13-
required: false
14-
jobs:
15-
docs:
16-
name: build & push docs
17-
runs-on: ${{ matrix.os }}
18-
timeout-minutes: 90
19-
strategy:
20-
matrix:
21-
os: ['ubuntu-latest']
22-
environment-file: [ci/313-latest.yaml]
23-
experimental: [false]
24-
defaults:
25-
run:
26-
shell: bash -l {0}
27-
28-
steps:
29-
- name: checkout repo
30-
uses: actions/checkout@v4
31-
with:
32-
fetch-depth: 0 # Fetch all history for all branches and tags.
33-
34-
- name: setup micromamba
35-
uses: mamba-org/setup-micromamba@v1
36-
with:
37-
environment-file: ${{ matrix.environment-file }}
38-
micromamba-version: 'latest'
39-
40-
- name: install pulp via pip
41-
run: pip install pulp
42-
43-
- name: install package
44-
run: pip install .
45-
46-
- name: make docs
47-
run: cd docs; make html
48-
49-
- name: commit docs
50-
run: |
51-
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
52-
cp -r docs/_build/html/* gh-pages/
53-
cd gh-pages
54-
git config --local user.email "action@github.com"
55-
git config --local user.name "GitHub Action"
56-
git add .
57-
git commit -m "Update documentation" -a || true
58-
# The above command will fail if no changes were present,
59-
# so we ignore the return code.
60-
61-
- name: push to gh-pages
62-
uses: ad-m/github-push-action@master
63-
with:
64-
branch: gh-pages
65-
directory: gh-pages
66-
github_token: ${{ secrets.GITHUB_TOKEN }}
67-
force: true
1+
---
2+
name: Build Docs
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: Manual Doc Build Reason
11+
default: test
12+
required: false
13+
jobs:
14+
docs:
15+
name: build & push docs
16+
runs-on: ${{ matrix.os }}
17+
timeout-minutes: 90
18+
strategy:
19+
matrix:
20+
os:
21+
- ubuntu-latest
22+
environment-file:
23+
- ci/py313_spopt-latest.yaml
24+
experimental:
25+
- false
26+
defaults:
27+
run:
28+
shell: bash -l {0}
29+
steps:
30+
- name: checkout repo
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
- name: setup micromamba
35+
uses: mamba-org/setup-micromamba@v2
36+
with:
37+
environment-file: ${{ matrix.environment-file }}
38+
micromamba-version: latest
39+
- name: install pulp via pip
40+
run: pip install pulp
41+
- name: install package
42+
run: pip install .
43+
- name: make docs
44+
run: cd docs; make html
45+
- name: Publish to Github Pages
46+
uses: peaceiris/actions-gh-pages@v4
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
publish_dir: docs/build/html/
50+
keep_files: false
Lines changed: 30 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,44 @@
1+
---
12
name: Release Package
2-
33
on:
44
push:
5-
# Sequence of patterns matched against refs/tags
65
tags:
7-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+
- v*
87
workflow_dispatch:
98
inputs:
109
version:
1110
description: Manual Release
1211
default: test
1312
required: false
14-
1513
jobs:
1614
build:
1715
runs-on: ubuntu-latest
1816
steps:
19-
20-
- name: Checkout repo
21-
uses: actions/checkout@v4
22-
with:
23-
fetch-depth: 0 # Fetch all history for all branches and tags.
24-
25-
- name: Set up Python
26-
uses: actions/setup-python@v4
27-
with:
28-
python-version: '3.x'
29-
30-
- name: Install Dependencies
31-
run: |
32-
python -m pip install --upgrade pip
33-
python -m pip install --upgrade build twine
34-
python -m build
35-
twine check --strict dist/*
36-
37-
- name: Create Release Notes
38-
uses: actions/github-script@v7
39-
with:
40-
github-token: ${{secrets.GITHUB_TOKEN}}
41-
script: |
42-
await github.request(`POST /repos/${{ github.repository }}/releases`, {
43-
tag_name: "${{ github.ref }}",
44-
generate_release_notes: true
45-
});
46-
47-
- name: Publish distribution 📦 to PyPI
48-
uses: pypa/gh-action-pypi-publish@release/v1
49-
with:
50-
user: __token__
51-
password: ${{ secrets.pypi_password }}
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: 3.x
25+
- name: Install Dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install --upgrade build twine
29+
python -m build
30+
twine check --strict dist/*
31+
- name: Create Release Notes
32+
uses: actions/github-script@v7
33+
with:
34+
github-token: ${{secrets.GITHUB_TOKEN}}
35+
script: >
36+
await github.request(`POST /repos/${{ github.repository }}/releases`, {
37+
tag_name: "${{ github.ref }}",
38+
generate_release_notes: true
39+
});
40+
- name: Publish distribution 📦 to PyPI
41+
uses: pypa/gh-action-pypi-publish@release/v1
42+
with:
43+
user: __token__
44+
password: ${{ secrets.pypi_password }}

.github/workflows/testing.yml

Lines changed: 69 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,78 @@
1-
name: Continuous Integration
2-
3-
on:
4-
push:
5-
branches:
6-
- '*'
7-
pull_request:
8-
branches:
9-
- '*'
10-
schedule:
11-
- cron: '59 23 * * *'
12-
workflow_dispatch:
1+
---
2+
name: Continuous Integration
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
pull_request:
8+
branches:
9+
- "*"
10+
schedule:
11+
- cron: 59 23 * * *
12+
workflow_dispatch:
1313
inputs:
1414
version:
1515
description: Manual CI Run
1616
default: test
1717
required: false
18-
19-
jobs:
20-
tests:
21-
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
22-
runs-on: ${{ matrix.os }}
23-
timeout-minutes: 30
24-
strategy:
25-
matrix:
26-
os: [ubuntu-latest]
27-
environment-file: [
28-
ci/311-oldest.yaml,
29-
ci/311-latest.yaml,
30-
ci/312-latest.yaml,
31-
ci/313-latest.yaml,
32-
ci/313-dev.yaml,
33-
]
34-
include:
35-
- environment-file: ci/313-latest.yaml
36-
os: macos-13 # Intel
37-
- environment-file: ci/313-latest.yaml
38-
os: macos-14 # Apple Silicon
39-
- environment-file: ci/313-latest.yaml
40-
os: windows-latest
41-
fail-fast: false
42-
43-
defaults:
44-
run:
45-
shell: bash -l {0}
46-
47-
steps:
48-
- name: checkout repo
49-
uses: actions/checkout@v4
50-
with:
51-
fetch-depth: 0 # Fetch all history for all branches and tags.
52-
53-
- name: setup micromamba
54-
uses: mamba-org/setup-micromamba@v1
55-
with:
56-
environment-file: ${{ matrix.environment-file }}
57-
micromamba-version: 'latest'
58-
59-
##############################################################################
60-
#- name: install pulp via pip
61-
# run: |
62-
# pip install pulp
63-
# pulptest
64-
##############################################################################
65-
66-
- name: environment info
67-
run: |
68-
micromamba info
69-
micromamba list
70-
71-
- name: spatial versions
72-
run: 'python -c "import geopandas; geopandas.show_versions();"'
73-
74-
- name: Download test files
75-
run: |
18+
jobs:
19+
tests:
20+
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 30
23+
strategy:
24+
matrix:
25+
os:
26+
- ubuntu-latest
27+
environment-file:
28+
- ci/py311_spopt-oldest.yaml
29+
- ci/py311_spopt-latest.yaml
30+
- ci/py312_spopt-latest.yaml
31+
- ci/py313_spopt-latest.yaml
32+
- ci/py313_spopt-dev.yaml
33+
include:
34+
- environment-file: ci/py313_spopt-latest.yaml
35+
os: macos-13
36+
- environment-file: ci/py313_spopt-latest.yaml
37+
os: macos-14
38+
- environment-file: ci/py313_spopt-latest.yaml
39+
os: windows-latest
40+
fail-fast: false
41+
defaults:
42+
run:
43+
shell: bash -l {0}
44+
steps:
45+
- name: checkout repo
46+
uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
- name: setup micromamba
50+
uses: mamba-org/setup-micromamba@v2
51+
with:
52+
environment-file: ${{ matrix.environment-file }}
53+
micromamba-version: latest
54+
- name: environment info
55+
run: |
56+
micromamba info
57+
micromamba list
58+
- name: spatial versions
59+
run: python -c "import geopandas; geopandas.show_versions();"
60+
- name: Download test files
61+
run: |
7662
python -c '
7763
import libpysal
7864
libpysal.examples.fetch_all()
7965
'
80-
81-
- name: run tests
82-
run: |
83-
pytest spopt \
84-
-v \
85-
-r a \
86-
-n logical \
87-
--color yes \
88-
--cov spopt \
89-
--cov-append \
90-
--cov-report term-missing \
91-
--cov-report xml .
92-
93-
- name: codecov
94-
uses: codecov/codecov-action@v4
66+
- name: run tests
67+
run: |
68+
pytest spopt \
69+
-v \
70+
-r a \
71+
-n logical \
72+
--color yes \
73+
--cov spopt \
74+
--cov-append \
75+
--cov-report term-missing \
76+
--cov-report xml .
77+
- name: codecov
78+
uses: codecov/codecov-action@v5
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test
1+
name: py311_spopt-latest
22
channels:
33
- conda-forge
44
dependencies:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test
1+
name: py311_spopt-oldest
22
channels:
33
- conda-forge
44
dependencies:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test
1+
name: py3112_spopt-latest
22
channels:
33
- conda-forge
44
dependencies:

ci/313-dev.yaml renamed to ci/py313_spopt-dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test
1+
name: py313_spopt-dev
22
channels:
33
- conda-forge
44
dependencies:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test
1+
name: py313_spopt-latest
22
channels:
33
- conda-forge
44
dependencies:

0 commit comments

Comments
 (0)