Try whether ccache decreases test times for Cython #956
Workflow file for this run
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
name: TestSuite | |
on: [push, pull_request] | |
jobs: | |
get_python_versions: | |
name: "Determine Python versions" | |
runs-on: ubuntu-latest | |
outputs: | |
min-python: ${{ steps.nep29.outputs.min-python }} | |
max-python: ${{ steps.nep29.outputs.max-python }} | |
steps: | |
- name: "calculate versions according to NEP29" | |
id: nep29 | |
uses: mstimberg/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
pre-commit: | |
name: Run linters with pre-commit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
cache-dependency-path: .devcontainer/dev-requirements.txt | |
- name: Install deps | |
run: pip3 install -r .devcontainer/dev-requirements.txt | |
- name: Run pre-commit hooks | |
run: pre-commit run --all-files --show-diff-on-failure | |
testing: | |
needs: [get_python_versions, pre-commit] | |
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }} (standalone: ${{ matrix.standalone }}, 32bit: ${{ matrix.float_dtype_32 }})" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, windows-2022, macOS-12, macOS-14] | |
standalone: [false] | |
float_dtype_32: [false] | |
python-version: ["${{ needs.get_python_versions.outputs.max-python }}"] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Conda and Python | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
auto-activate-base: false | |
miniforge-version: latest | |
activate-environment: 'test_env' | |
python-version: ${{ matrix.python-version }} | |
- name: Install Brian2 and dependencies | |
run: | | |
conda install --quiet --yes pip gsl | |
python -m pip install .[test] coverage | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
create-symlink: true | |
- name: Run Tests | |
run: | | |
cd $GITHUB_WORKSPACE/.. # move out of the workspace to avoid direct import | |
coverage run --rcfile=$GITHUB_WORKSPACE/.coveragerc $GITHUB_WORKSPACE/$SCRIPT_NAME | |
coverage lcov --rcfile=$GITHUB_WORKSPACE/.coveragerc | |
cp coverage.lcov $GITHUB_WORKSPACE/ | |
env: | |
SCRIPT_NAME: dev/continuous-integration/run_test_suite.py | |
SPHINX_DIR: ${{ github.workspace }}/docs_sphinx | |
AGENT_OS: ${{runner.os}} | |
STANDALONE: ${{ matrix.standalone }} | |
FLOAT_DTYPE_32: ${{ matrix.float_dtype_32 }} | |
- name: Send coverage to Coveralls (parallel) | |
if: ${{ startsWith(matrix.os, 'ubuntu-') && matrix.python-version == needs.get_python_versions.outputs.max-python }} | |
uses: coverallsapp/[email protected] | |
with: | |
parallel: true | |
format: lcov | |
file: coverage.lcov | |
flag-name: run ${{ join(matrix.*, ' - ') }} | |
coveralls: | |
name: Indicate completion to coveralls.io | |
needs: testing | |
runs-on: ubuntu-latest | |
steps: | |
- name: Close parallel build | |
uses: coverallsapp/[email protected] | |
with: | |
parallel-finished: true | |
test_doc_build: | |
needs: get_python_versions | |
name: Test building the documentation | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Setup Conda and Python | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
auto-activate-base: false | |
miniforge-version: latest | |
activate-environment: 'test_env' | |
python-version: "${{ needs.get_python_versions.outputs.max-python }}" | |
- name: Install dependencies | |
run: pip install -r rtd-requirements.txt | |
- name: Install brian2 | |
run: pip install . | |
- name: Build HTML documentation | |
run: | | |
cd docs_sphinx | |
sphinx-build -b html . ../docs | |
env: | |
READTHEDOCS: True |