-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to copier #170
Move to copier #170
Changes from 6 commits
09a0a00
aaabf9d
35d5926
0ff671a
5cd71a4
ac23da5
6d8dbb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY | ||
_commit: 542e56b | ||
_src_path: gh:scipp/copier_template | ||
description: An h5py-like utility for NeXus files with seamless Scipp integration | ||
max_python: '3.12' | ||
min_python: '3.8' | ||
namespace_package: '' | ||
nightly_deps: scipp | ||
orgname: scipp | ||
projectname: scippnexus | ||
related_projects: Scipp,ScippNeutron | ||
year: 2023 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) | ||
|
||
name: Docs | ||
|
||
on: | ||
|
@@ -36,35 +39,31 @@ env: | |
jobs: | ||
docs: | ||
name: Build documentation | ||
runs-on: ubuntu-20.04 | ||
runs-on: 'ubuntu-20.04' | ||
steps: | ||
- run: sudo apt install --yes graphviz pandoc | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.branch == '' && github.ref_name || inputs.branch }} | ||
fetch-depth: 0 # history required so cmake can determine version | ||
- uses: actions/setup-python@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
python-version-file: '.github/workflows/python-version-ci' | ||
- run: python -m pip install --upgrade pip | ||
- run: python -m pip install -r requirements/ci.txt | ||
- run: | | ||
tox --skip-pkg-install -e docs -- scippnexus==${VERSION} | ||
echo "target=$(python docs/version.py --version=${VERSION} --action=get-target)" >> $GITHUB_ENV | ||
if: ${{ inputs.publish }} | ||
- run: tox -e releasedocs -- ${VERSION} | ||
if: ${{ inputs.version != '' }} | ||
- run: tox -e docs | ||
if: ${{ !inputs.publish }} | ||
if: ${{ inputs.version == '' }} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: html | ||
name: docs_html | ||
path: html/ | ||
|
||
- uses: JamesIves/[email protected] | ||
if: ${{ inputs.publish }} | ||
with: | ||
branch: gh-pages | ||
folder: html | ||
target-folder: ${{ env.target }} | ||
single-commit: true | ||
clean-exclude: release | ||
ssh-key: ${{ secrets.GH_PAGES_DEPLOY_KEY }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) | ||
|
||
name: Nightly test at main branch | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '30 23 * * *' | ||
|
||
jobs: | ||
setup: | ||
name: Setup variables | ||
runs-on: 'ubuntu-20.04' | ||
outputs: | ||
min_python: ${{ steps.vars.outputs.min_python }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Get Python version for other CI jobs | ||
id: vars | ||
run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT | ||
|
||
tests: | ||
name: Tests | ||
needs: setup | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-20.04'] | ||
python: | ||
- version: '${{needs.setup.outputs.min_python}}' | ||
tox-env: 'nightly' | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
os-variant: ${{ matrix.os }} | ||
python-version: ${{ matrix.python.version }} | ||
tox-env: ${{ matrix.python.tox-env }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) | ||
|
||
name: Nightly tests at latest release | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 23 * * *' | ||
|
||
jobs: | ||
setup: | ||
name: Setup variables | ||
runs-on: 'ubuntu-20.04' | ||
outputs: | ||
min_python: ${{ steps.vars.outputs.min_python }} | ||
release_tag: ${{ steps.release.outputs.release_tag }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # history required so we can determine latest release tag | ||
- name: Get last release tag from git | ||
id: release | ||
run: echo "release_tag=$(git describe --tags --abbrev=0 --match '[0-9]*.[0-9]*.[0-9]*')" >> $GITHUB_OUTPUT | ||
- name: Get Python version for other CI jobs | ||
id: vars | ||
run: echo "min_python=$(cat .github/workflows/python-version-ci)" >> $GITHUB_OUTPUT | ||
|
||
tests: | ||
name: Tests | ||
needs: setup | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-20.04'] | ||
python: | ||
- version: '${{needs.setup.outputs.min_python}}' | ||
tox-env: 'nightly' | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
os-variant: ${{ matrix.os }} | ||
python-version: ${{ matrix.python.version }} | ||
tox-env: ${{ matrix.python.tox-env }} | ||
checkout_ref: ${{ needs.setup.outputs.release_tag }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) | ||
|
||
name: Release | ||
|
||
on: | ||
|
@@ -12,35 +15,39 @@ defaults: | |
jobs: | ||
build_conda: | ||
name: Conda build | ||
runs-on: ubuntu-20.04 | ||
runs-on: 'ubuntu-20.04' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 # history required so cmake can determine version | ||
fetch-depth: 0 # history required so setuptools_scm can determine version | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
- run: conda install --yes conda-build | ||
- run: conda build --channel conda-forge --channel scipp --python=3.8 --no-anaconda-upload --override-channels --output-folder conda/package conda | ||
- uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-name: build-env | ||
create-args: >- | ||
conda-build | ||
boa | ||
- run: conda mambabuild --channel conda-forge --channel scipp --no-anaconda-upload --override-channels --output-folder conda/package conda | ||
|
||
- uses: actions/upload-artifact@v2 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: conda-package-noarch | ||
path: conda/package/*/scippnexus*.tar.bz2 | ||
path: conda/package/noarch/*.tar.bz2 | ||
|
||
build_wheels: | ||
name: Wheels | ||
runs-on: ubuntu-20.04 | ||
runs-on: 'ubuntu-20.04' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # history required so setuptools_scm can determine version | ||
|
||
- uses: actions/setup-python@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
python-version-file: '.github/workflows/python-version-ci' | ||
|
||
- run: python -m pip install --upgrade pip | ||
- run: python -m pip install -r requirements/wheels.txt | ||
|
@@ -57,65 +64,53 @@ jobs: | |
upload_pypi: | ||
name: Deploy PyPI | ||
needs: [build_wheels, build_conda] | ||
runs-on: ubuntu-20.04 | ||
runs-on: 'ubuntu-20.04' | ||
environment: release | ||
permissions: | ||
id-token: write | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
|
||
upload_conda: | ||
name: Deploy Conda Forge | ||
name: Deploy Conda | ||
needs: [build_wheels, build_conda] | ||
runs-on: ubuntu-20.04 | ||
runs-on: 'ubuntu-20.04' | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
- uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
python-version: '3.10' | ||
- run: conda install -c conda-forge --yes anaconda-client | ||
- run: anaconda --token ${{ secrets.ANACONDATOKEN }} upload --user scipp --label main $(ls conda-package-*/*/*.tar.bz2) | ||
|
||
manage-versions: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to manually clean up the gh-pages branch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the settings in the deploy action in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like it. Let's keep an eye on it in the next release. |
||
name: Manage Versions | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
version-new: ${{ steps.version.outputs.new }} | ||
version-replaced: ${{ steps.version.outputs.replaced }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # history required so cmake can determine version | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.8' | ||
- run: python -m pip install --upgrade pip | ||
- run: python -m pip install -r requirements/ci.txt | ||
- name: Set outputs | ||
id: version | ||
run: | | ||
echo "new=$(python docs/version.py --version=${GITHUB_REF_NAME} --action=is-new)" >> $GITHUB_OUTPUT | ||
echo "replaced=$(python docs/version.py --version=${GITHUB_REF_NAME} --action=get-replaced)" >> $GITHUB_OUTPUT | ||
environment-name: upload-env | ||
# frozen python due to breaking removal of 'imp' in 3.12 | ||
create-args: >- | ||
anaconda-client | ||
python=3.11 | ||
- run: anaconda --token ${{ secrets.ANACONDATOKEN }} upload --user scipp --label main $(ls conda-package-noarch/*.tar.bz2) | ||
|
||
docs: | ||
needs: [upload_conda, upload_pypi, manage-versions] | ||
needs: [upload_conda, upload_pypi] | ||
uses: ./.github/workflows/docs.yml | ||
with: | ||
publish: ${{ github.event_name == 'release' && github.event.action == 'published' }} | ||
version: ${{ github.ref_name }} | ||
secrets: inherit | ||
|
||
replaced-docs: | ||
assets: | ||
name: Upload docs | ||
needs: docs | ||
if: github.event_name == 'release' && github.event.action == 'published' && needs.manage-versions.outputs.version-new == 'True' | ||
uses: ./.github/workflows/docs.yml | ||
with: | ||
publish: true | ||
version: ${{ needs.manage-versions.outputs.version-replaced }} | ||
secrets: inherit | ||
runs-on: 'ubuntu-20.04' | ||
permissions: | ||
contents: write # This is needed so that the action can upload the asset | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- name: Zip documentation | ||
run: | | ||
mv docs_html documentation-${{ github.ref_name }} | ||
zip -r documentation-${{ github.ref_name }}.zip documentation-${{ github.ref_name }} | ||
- name: Upload release assets | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
file: ./documentation-${{ github.ref_name }}.zip | ||
overwrite: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So now this only runs with a single python version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I considered keeping multiple versions, but felt there was little benefit at this point.