Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 14eaf11
_commit: 6ee5264
_src_path: gh:scipp/copier_template
description: Flux simulation toy building library.
github_linux_image: ubuntu-20.04
max_python: '3.11'
max_python: '3.12'
min_python: '3.10'
namespace_package: ''
nightly_deps: ''
orgname: physicscore
prettyname: Thermoblock
projectname: thermoblock
year: 2023
related_projects: ''
year: 2024
12 changes: 4 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
ignore:
# Optional: Official actions have moving tags like v1;
# if you use those, you don't need updates.
- dependency-name: "actions/*"
# Note: We are not listing package-ecosystem: "github-actions". This causes
# noise in all template instances. Instead dependabot.yml in scipp/copier_template
# triggers updates of github-actions in the *template*. We then use `copier update`
# in template instances.
- package-ecosystem: "pip"
directory: "/requirements"
schedule:
Expand Down
38 changes: 22 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: CI

on:
Expand All @@ -11,30 +10,37 @@ on:
jobs:
formatting:
name: Formatting and static analysis
runs-on: 'ubuntu-20.04'
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@v3
- uses: actions/setup-python@v3
- 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@v5
with:
python-version-file: '.github/workflows/python-version-ci'
- uses: pre-commit/action@v3.0.1
with:
python-version: '3.10'
- 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@v4
extra_args: --all-files
- uses: pre-commit-ci/lite-action@v1.0.2
if: always()
with:
commit_message: Apply automatic formatting
msg: Apply automatic formatting

tests:
name: Tests
needs: formatting
strategy:
matrix:

os: ['ubuntu-20.04']
os: ['ubuntu-22.04']
python:
- version: '3.10'
tox-env: 'py310'

- version: '${{needs.formatting.outputs.min_python}}'
tox-env: '${{needs.formatting.outputs.min_tox_env}}'
uses: ./.github/workflows/test.yml
with:
os-variant: ${{ matrix.os }}
Expand All @@ -46,5 +52,5 @@ jobs:
uses: ./.github/workflows/docs.yml
with:
publish: false
version: ${{ github.ref_name }}
linkcheck: ${{ contains(matrix.variant.os, 'ubuntu') && github.ref == 'refs/heads/main' }}
branch: ${{ github.head_ref == '' && github.ref_name || github.head_ref }}
35 changes: 17 additions & 18 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Docs

on:
Expand Down Expand Up @@ -30,45 +29,45 @@ on:
default: ''
required: false
type: string
linkcheck:
description: 'Run the link checker. If not set the link checker will not be run.'
default: false
required: false
type: boolean

env:
VERSION: ${{ inputs.version }}

jobs:
docs:
name: Build documentation
runs-on: 'ubuntu-20.04'
runs-on: 'ubuntu-22.04'
steps:

- run: sudo apt install --yes graphviz pandoc
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch == '' && github.ref_name || inputs.branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0 # history required so cmake can determine version
- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:

python-version: '3.10'
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 -- thermoblock==${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 }}
- uses: actions/upload-artifact@v3
if: ${{ inputs.version == '' }}
- run: tox -e linkcheck
if: ${{ inputs.linkcheck }}
- uses: actions/upload-artifact@v4
with:
name: html
name: docs_html
path: html/

- uses: JamesIves/github-pages-deploy-action@v4.6.0
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 }}
1 change: 1 addition & 0 deletions .github/workflows/python-version-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
126 changes: 0 additions & 126 deletions .github/workflows/release.yml

This file was deleted.

24 changes: 13 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 PhysicsCore contributors (https://github.com/physicscore)

name: Test

on:
workflow_dispatch:
inputs:
os-variant:
default: 'ubuntu-20.04'
default: 'ubuntu-22.04'
type: string
python-version:
default: '3.10'
type: string
tox-env:
default: 'test'
Expand All @@ -21,13 +17,15 @@ on:
coverage-report:
default: false
type: boolean
checkout_ref:
default: ''
type: string
workflow_call:
inputs:
os-variant:
default: 'ubuntu-20.04'
default: 'ubuntu-22.04'
type: string
python-version:
default: '3.10'
type: string
tox-env:
default: 'test'
Expand All @@ -38,22 +36,26 @@ on:
coverage-report:
default: false
type: boolean
checkout_ref:
default: ''
type: string

jobs:
test:
runs-on: ${{ inputs.os-variant }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout_ref }}
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- run: python -m pip install --upgrade pip
- run: python -m pip install -r ${{ inputs.pip-recipe }}
- run: tox -e ${{ inputs.tox-env }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ inputs.coverage-report }}
with:
name: CoverageReport
path: coverage_html/

19 changes: 16 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Build artifacts
build
dist
html
.tox
src/thermoblock.egg-info
*.egg-info

*.sw?

# Environments
venv

# Caches
.clangd/
.idea/
.vscode/
*.ipynb_checkpoints
__pycache__/
.vs/
Expand All @@ -16,3 +20,12 @@ __pycache__/
.pytest_cache
.mypy_cache
docs/generated/

# Editor settings
.idea/
.vscode/

# Data files
*.data
*.dat
*.csv
Loading