Skip to content

Commit bc3b435

Browse files
authored
Merge pull request #57 from jcwang587/dev
Prepare Geddes 1.0: XRD readers, x/y API, and package checks
2 parents 48e481b + da81a36 commit bc3b435

129 files changed

Lines changed: 580282 additions & 1292 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-node.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Check Node packages
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
version:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v7
14+
- uses: actions/setup-python@v7
15+
with:
16+
python-version: "3.12"
17+
- run: python tests/check_release_version.py
18+
19+
build:
20+
needs: version
21+
runs-on: ${{ matrix.host }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
include:
26+
- host: windows-latest
27+
target: x86_64-pc-windows-msvc
28+
flags: ""
29+
- host: windows-11-arm
30+
target: aarch64-pc-windows-msvc
31+
flags: ""
32+
- host: macos-15-intel
33+
target: x86_64-apple-darwin
34+
flags: ""
35+
- host: macos-latest
36+
target: aarch64-apple-darwin
37+
flags: ""
38+
- host: ubuntu-latest
39+
target: x86_64-unknown-linux-gnu
40+
flags: --use-napi-cross
41+
- host: ubuntu-latest
42+
target: aarch64-unknown-linux-gnu
43+
flags: --use-napi-cross
44+
steps:
45+
- uses: actions/checkout@v7
46+
- uses: actions/setup-node@v7
47+
with:
48+
node-version: "24"
49+
cache: npm
50+
cache-dependency-path: node/package-lock.json
51+
- uses: dtolnay/rust-toolchain@stable
52+
with:
53+
targets: ${{ matrix.target }}
54+
- run: npm ci
55+
working-directory: node
56+
- name: Build native binding and loader
57+
working-directory: node
58+
run: npm run build -- --target ${{ matrix.target }} ${{ matrix.flags }} -- --locked
59+
- uses: actions/upload-artifact@v7
60+
with:
61+
name: bindings-${{ matrix.target }}
62+
path: |
63+
node/geddes.*.node
64+
node/index.js
65+
node/index.d.ts
66+
if-no-files-found: error
67+
68+
pack:
69+
needs: build
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v7
73+
- uses: actions/setup-node@v7
74+
with:
75+
node-version: "24"
76+
cache: npm
77+
cache-dependency-path: node/package-lock.json
78+
- run: npm ci
79+
working-directory: node
80+
- uses: actions/download-artifact@v8
81+
with:
82+
pattern: bindings-*
83+
path: node/artifacts
84+
- name: Pack the JS package and all native packages
85+
working-directory: node
86+
run: npm run pack:release -- artifacts packages
87+
- uses: actions/upload-artifact@v7
88+
with:
89+
name: node-packages
90+
path: node/packages/*
91+
if-no-files-found: error
92+
93+
install-test:
94+
needs: pack
95+
runs-on: ${{ matrix.host }}
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
host: [ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest, windows-latest, windows-11-arm]
100+
node-version: ["16", "24"]
101+
exclude:
102+
- host: windows-11-arm
103+
node-version: "16"
104+
include:
105+
# Node 16 has no Windows ARM64 distribution.
106+
- host: windows-11-arm
107+
node-version: "20"
108+
steps:
109+
- uses: actions/checkout@v7
110+
- uses: actions/setup-node@v7
111+
with:
112+
node-version: ${{ matrix.node-version }}
113+
- uses: actions/download-artifact@v8
114+
with:
115+
name: node-packages
116+
path: node/packages
117+
- name: Install tarballs and test the public loader
118+
working-directory: node
119+
run: npm run check:package -- packages
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check packages
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
workflow_dispatch:
9+
workflow_call:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
rust:
16+
name: Check Rust distribution
17+
uses: ./.github/workflows/check-rust.yml
18+
python:
19+
name: Check Python distributions
20+
uses: ./.github/workflows/check-python.yml
21+
node:
22+
name: Check Node distributions
23+
uses: ./.github/workflows/check-node.yml

.github/workflows/check-python.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: check Python packages
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
version:
11+
name: Package version agreement
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v7
15+
- uses: actions/setup-python@v7
16+
with:
17+
python-version: "3.12"
18+
- name: Check package and tag versions
19+
run: python tests/check_release_version.py
20+
21+
wheels:
22+
name: Wheel / ${{ matrix.os }} / Python ${{ matrix.python-version }}
23+
runs-on: ${{ matrix.os }}
24+
needs: version
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
os: [ubuntu-latest, macos-latest, windows-latest]
29+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v7
33+
- name: Set up Python
34+
uses: actions/setup-python@v7
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
- name: Build manylinux wheel
38+
if: matrix.os == 'ubuntu-latest'
39+
uses: PyO3/maturin-action@v1
40+
with:
41+
command: build
42+
args: --release --locked --out dist -i python${{ matrix.python-version }}
43+
manylinux: auto
44+
- name: Build wheel
45+
if: matrix.os != 'ubuntu-latest'
46+
uses: PyO3/maturin-action@v1
47+
with:
48+
command: build
49+
args: --release --locked --out dist -i python
50+
- name: Install and test the built wheel
51+
run: python tests/check_python_package.py --dist-dir dist --kind wheel
52+
- name: Upload checked wheel
53+
uses: actions/upload-artifact@v7
54+
with:
55+
name: checked-python-wheel-${{ matrix.os }}-${{ matrix.python-version }}
56+
path: dist/*.whl
57+
if-no-files-found: error
58+
59+
sdist:
60+
name: Source distribution / Python 3.12
61+
runs-on: ubuntu-latest
62+
needs: version
63+
steps:
64+
- name: Checkout code
65+
uses: actions/checkout@v7
66+
- name: Set up Python
67+
uses: actions/setup-python@v7
68+
with:
69+
python-version: "3.12"
70+
- name: Build source distribution
71+
uses: PyO3/maturin-action@v1
72+
with:
73+
command: sdist
74+
args: --out dist
75+
- name: Build, install, and test the source distribution
76+
run: python tests/check_python_package.py --dist-dir dist --kind sdist
77+
- name: Upload checked source distribution
78+
uses: actions/upload-artifact@v7
79+
with:
80+
name: checked-python-sdist
81+
path: dist/*.tar.gz
82+
if-no-files-found: error

.github/workflows/check-rust.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Check Rust package
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
checked-crate:
12+
name: Rust crate (${{ matrix.os }})
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
steps:
19+
- uses: actions/checkout@v7
20+
- uses: actions/setup-python@v6
21+
with:
22+
python-version: "3.12"
23+
- uses: dtolnay/rust-toolchain@stable
24+
- name: Check package versions and tag
25+
id: version
26+
run: python tests/check_release_version.py
27+
- name: Test release version validation
28+
run: python -m unittest discover -s tests -p release_version_cases.py
29+
- name: Test repository sources
30+
run: cargo test --locked
31+
- name: Package and verify the distributable crate
32+
run: cargo package --locked
33+
- name: Test the unpacked distributable crate
34+
working-directory: target/package/geddes-${{ steps.version.outputs.version }}
35+
run: cargo test --locked
36+
- name: Retain the checked crate
37+
uses: actions/upload-artifact@v7
38+
with:
39+
name: checked-rust-crate-${{ matrix.os }}
40+
path: target/package/*.crate
41+
if-no-files-found: error
42+
retention-days: 7

.github/workflows/docs.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "docs/**"
8+
- "overrides/**"
9+
- "zensical.toml"
10+
- "requirements-docs.txt"
11+
- ".github/workflows/docs.yml"
12+
pull_request:
13+
branches: [main]
14+
paths:
15+
- "docs/**"
16+
- "overrides/**"
17+
- "zensical.toml"
18+
- "requirements-docs.txt"
19+
- ".github/workflows/docs.yml"
20+
workflow_dispatch:
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v7
30+
- uses: actions/setup-python@v6
31+
with:
32+
python-version: "3.12"
33+
cache: pip
34+
cache-dependency-path: requirements-docs.txt
35+
- name: Install documentation dependencies
36+
run: python -m pip install -r requirements-docs.txt
37+
- name: Build documentation
38+
run: zensical build --clean --strict
39+
- name: Upload generated site
40+
uses: actions/upload-pages-artifact@v5
41+
with:
42+
path: site/
43+
44+
deploy:
45+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
46+
needs: build
47+
runs-on: ubuntu-latest
48+
permissions:
49+
pages: write
50+
id-token: write
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
concurrency:
55+
group: github-pages
56+
cancel-in-progress: false
57+
steps:
58+
- name: Configure GitHub Pages
59+
uses: actions/configure-pages@v6
60+
- name: Deploy documentation
61+
id: deployment
62+
uses: actions/deploy-pages@v5

0 commit comments

Comments
 (0)