Skip to content

Calculate psi values on a sparse grid, to accelerate multiple calculations. #1249

Calculate psi values on a sparse grid, to accelerate multiple calculations.

Calculate psi values on a sparse grid, to accelerate multiple calculations. #1249

Workflow file for this run

---
name: Coverage test
defaults:
run:
shell: bash
env:
CFLAGS: -Og
on:
push:
branches: [main]
paths:
- '**.py'
- '**.ipynb'
pull_request:
paths:
- '**.py'
- '**.ipynb'
schedule:
# only once every 4 days
# We can always force run this.
- cron: '37 10 */4 * *'
workflow_dispatch:
inputs:
branch:
description: 'Which branch to test'
required: false
default: 'main'
marks:
description: 'Which marks to test'
required: false
default: ''
verbose:
description: 'Run pytest with -vvv'
required: false
type: boolean
jobs:
# Define a few jobs that can be runned
lint:
uses: ./.github/workflows/linter.yml
runnable:
if: |
github.event_name == 'schedule'
&& github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: '${{ github.event.inputs.branch }}'
- run: test -n $(git rev-list --after="1 week" --max-count=1 ${{ github.sha }})
test_runs:
needs: [lint, runnable]
if: |
always() &&
contains(needs.lint.result, 'success') &&
(contains(needs.runnable.result, 'success') || contains(needs.runnable.result, 'skipped'))
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.12']
full: [true]
include:
# Run a minimal dependency check for 3.9
# This is not per-see a minimal dependency check.
# However, it checks that sisl can run without viz
# and those dependencies.
- python-version: '3.9'
os: ubuntu-latest
full: false
steps:
- name: Checkout sisl
uses: actions/checkout@v4
with:
ref: '${{ github.event.inputs.branch }}'
# The files submodule is required for tests purposes
submodules: ${{ matrix.full }}
# the 'files' submodule uses lfs
lfs: ${{ matrix.full }}
- name: Print-out commit information
run: |
echo "branch: ${{ github.event.inputs.branch }}"
echo "hash: ${{ github.sha }}"
echo "python-version: ${{ matrix.python-version }}"
# This should generally not be required, but in the end it is just easier
- name: Ensure system dependencies
run: |
sudo apt-get update
sudo apt-get install gcc gfortran
- name: Python installation
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install sisl + dependencies
env:
SKBUILD_CMAKE_ARGS: -DWITH_COVERAGE:bool=true;-DWITH_LINE_DIRECTIVES:bool=true
run: |
python -m pip install --progress-bar=off --upgrade pip
if [[ "${{ matrix.full }}" == "true" ]]; then
CC=gcc FC=gfortran python -m pip install --progress-bar=off -vvv .[test,viz]
else
CC=gcc FC=gfortran python -m pip install --progress-bar=off -vvv .[test]
fi
- name: Running sisl import test
run: |
sgeom --help
stoolbox atom-plot --help
- name: Running sisl tests
env:
SISL_NUM_PROCS: 1
OMP_NUM_THREADS: 1
SISL_FILES_TESTS: ${{ github.workspace }}/files/tests
run: |
ls -al
if [[ "${{ github.event.inputs.marks }}" == "" ]]; then
ADD_FLAGS=""
else
ADD_FLAGS="-m ${{ github.event.inputs.marks }}"
fi
if [[ "${{ github.event.inputs.verbose }}" == "true" ]]; then
ADD_FLAGS="$ADD_FLAGS -vvv"
fi
ADD_TOOLS=""
for tool in btd models ; do
ADD_TOOLS="$ADD_TOOLS sisl_toolbox.$tool"
done
for tool in atom minimizer ; do
ADD_TOOLS="$ADD_TOOLS sisl_toolbox.siesta.$tool"
done
for tool in poisson ; do
ADD_TOOLS="$ADD_TOOLS sisl_toolbox.transiesta.$tool"
done
# Try to enable code-coverage in the tests
coverage run -m pytest --pyargs sisl $ADD_FLAGS $ADD_TOOLS
ls -al
- name: Upload code-coverage
if: ${{ github.event.inputs.marks == '' }}
uses: codecov/codecov-action@v4
with:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}