Skip to content

Commit

Permalink
Revert "ci: removed other workflows to test only linkcheck."
Browse files Browse the repository at this point in the history
This reverts commit 1503b84.
  • Loading branch information
gtdang committed Aug 8, 2024
1 parent 03b3bcb commit f24f31c
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
45 changes: 45 additions & 0 deletions .github/workflows/issue-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Monthly issue metrics

on:
workflow_dispatch:
schedule:
- cron: '3 2 1 * *'

permissions:
contents: write

jobs:
build:
name: issue metrics
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: read

steps:

- name: Get dates for last month
shell: bash
run: |
# Calculate the first day of the previous month
first_day=$(date -d "last month" +%Y-%m-01)
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
#Set an environment variable with the date range
echo "$first_day..$last_day"
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
- name: Run issue-metrics tool
uses: github/issue-metrics@v3
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:jonescompneurolab/hnn-core is:issue created:${{ env.last_month }}'

- name: Create issue
uses: peter-evans/create-issue-from-file@v4
with:
title: Monthly issue metrics report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
68 changes: 68 additions & 0 deletions .github/workflows/unix_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Unit tests

on:
push:
branches: ['**']
pull_request:
branches: ['**']

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest,macos-latest]
python-version: [3.8, 3.11, 3.12]

steps:
- uses: actions/checkout@v4

- name: Install Ubuntu System dependencies
if: matrix.os == 'ubuntu-latest'
shell: bash -el {0}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install libopenmpi-dev openmpi-bin
- name: Activate conda environment for macOS
if: matrix.os == 'macos-latest'
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
python-version: ${{ matrix.python-version }}
fetch-depth: 2

- name: Activate Python environment for Ubuntu
if: matrix.os == 'ubuntu-latest'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Python dependencies
shell: bash -el {0}
run: |
if [ ${{ matrix.os }} == 'macos-latest' ]; then
python -m pip install --upgrade pip
conda install --yes -c conda-forge mpi4py openmpi
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
python -m pip install --upgrade pip
python -m pip install mpi4py
fi
- name: Install HNN-core
shell: bash -el {0}
run: |
pip install --verbose '.[opt, parallel, test, gui]'
- name: Lint with flake8
shell: bash -el {0}
run: |
flake8 --count hnn_core
- name: Test with pytest
shell: bash -el {0}
run: |
python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml
- name: Upload coverage to Codecov
shell: bash -el {0}
run: |
bash <(curl -s https://codecov.io/bash) -f ./coverage.xml
45 changes: 45 additions & 0 deletions .github/workflows/windows_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Unit test

on:
push:
branches: ['**']
pull_request:
branches: ['**']

env:
PYTHONPATH: C:\nrn_test\lib\python
NEURONHOME: C:\nrn_test

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python-version: [3.8, 3.11, 3.12]

steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
python-version: ${{ matrix.python-version }}
- name: Install Neuron on Windows separately
shell: cmd
run: |
powershell -command "gh release download --repo https://github.com/neuronsimulator/nrn --pattern '*.exe' --output nrn-setup.exe"
start /b /wait .\nrn-setup.exe /S /D=C:\nrn_test
powershell -command "'C:\nrn_test\bin' >> $env:GITHUB_PATH"
python -c "import neuron"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies and HNN
shell: cmd
run: |
python -m pip install --upgrade pip
pip install --verbose .[opt,parallel,test,gui]
- name: Test with pytest
shell: cmd
run: |
python -m pytest ./hnn_core/tests/

0 comments on commit f24f31c

Please sign in to comment.