-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #471 from scipp/copier-template
Use copier template
- Loading branch information
Showing
76 changed files
with
2,043 additions
and
1,942 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY | ||
_commit: ff7f76b | ||
_src_path: gh:scipp/copier_template | ||
description: Neutron scattering tools for Data Reduction | ||
max_python: '3.11' | ||
min_python: '3.9' | ||
namespace_package: '' | ||
nightly_deps: scipp,scippnexus,plopp | ||
orgname: scipp | ||
prettyname: ScippNeutron | ||
projectname: scippneutron | ||
related_projects: Scipp,ScippNexus,Plopp | ||
year: 2023 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- release | ||
pull_request: | ||
|
||
jobs: | ||
formatting: | ||
name: Formatting and static analysis | ||
runs-on: 'ubuntu-22.04' | ||
outputs: | ||
min_python: ${{ steps.vars.outputs.min_python }} | ||
min_tox_env: ${{ steps.vars.outputs.min_tox_env }} | ||
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 | ||
echo "min_tox_env=py$(cat .github/workflows/python-version-ci | sed 's/\.//g')" >> $GITHUB_OUTPUT | ||
- uses: actions/setup-python@v4 | ||
with: | ||
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 -e static | ||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: Apply automatic formatting | ||
|
||
tests: | ||
name: Tests | ||
needs: formatting | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-22.04'] | ||
python: | ||
- version: '${{needs.formatting.outputs.min_python}}' | ||
tox-env: '${{needs.formatting.outputs.min_tox_env}}' | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
os-variant: ${{ matrix.os }} | ||
python-version: ${{ matrix.python.version }} | ||
tox-env: ${{ matrix.python.tox-env }} | ||
|
||
docs: | ||
needs: tests | ||
uses: ./.github/workflows/docs.yml | ||
with: | ||
publish: false | ||
branch: ${{ github.head_ref == '' && github.ref_name || github.head_ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) | ||
|
||
name: Docs | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
publish: | ||
default: false | ||
type: boolean | ||
version: | ||
default: '' | ||
required: false | ||
type: string | ||
branch: | ||
description: 'Branch/tag with documentation source. If not set, the current branch will be used.' | ||
default: '' | ||
required: false | ||
type: string | ||
workflow_call: | ||
inputs: | ||
publish: | ||
default: false | ||
type: boolean | ||
version: | ||
default: '' | ||
required: false | ||
type: string | ||
branch: | ||
description: 'Branch/tag with documentation source. If not set, the current branch will be used.' | ||
default: '' | ||
required: false | ||
type: string | ||
|
||
env: | ||
VERSION: ${{ inputs.version }} | ||
|
||
jobs: | ||
docs: | ||
name: Build documentation | ||
runs-on: 'ubuntu-22.04' | ||
defaults: | ||
run: | ||
shell: bash -l {0} # required for conda env | ||
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: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: .buildconfig/ci-linux.yml | ||
cache-environment: true | ||
create-args: >- | ||
python=3.10 | ||
conda-build | ||
- run: conda develop src | ||
if: ${{ inputs.version == '' }} | ||
- run: conda install -c scipp 'scippneutron==${{ inputs.version }}' | ||
if: ${{ inputs.version != '' }} | ||
- run: | | ||
python -m sphinx -j2 -v -b html -d doctrees docs html | ||
python -m sphinx -j2 -v -b doctest -d doctrees docs html | ||
find html -type f -name "*.ipynb" -not -path "html/_sources/*" -delete | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: docs_html | ||
path: html/ | ||
|
||
- uses: JamesIves/github-pages-deploy-action@v4.4.3 | ||
if: ${{ inputs.publish }} | ||
with: | ||
branch: gh-pages | ||
folder: html | ||
single-commit: true | ||
ssh-key: ${{ secrets.GH_PAGES_DEPLOY_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 1 * * 1-5' | ||
|
||
jobs: | ||
setup: | ||
name: Setup variables | ||
runs-on: 'ubuntu-22.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-22.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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 1 * * 1-5' | ||
|
||
jobs: | ||
setup: | ||
name: Setup variables | ||
runs-on: 'ubuntu-22.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-22.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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.9 |
Oops, something went wrong.