Skip to content

Commit

Permalink
Make caches on branches read only (#1327)
Browse files Browse the repository at this point in the history
* make caches on branches match base branch as read only

* bug with extra line

* another typo

* remove re-run tests on ready for nwb streaming test
  • Loading branch information
h-mayorquin authored Feb 16, 2023
1 parent 8385a4c commit ed9f3f5
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/caches_cron_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ name: Create caches for gin ecephys data and virtual env

on:
workflow_dispatch:
push: # When someting is pushed into main this checks if caches need to re-created
branches:
- main
schedule:
- cron: "0 12 * * *" # Daily at noon UTC

jobs:

create-virtual-env-cache-if-missing:
name: Caching virtual env
runs-on: "ubuntu-latest"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/core-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Testing core
on:
pull_request:
branches: [master]
types: [synchronize, opened, reopened, ready_for_review]
types: [synchronize, opened, reopened]

concurrency: # Cancel previous workflows on the same pull request
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install -U pip # Official recommended way
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/full-test-with-codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Full spikeinterface tests codecov
on:
workflow_dispatch:
schedule:
- cron: "0 12 * * *" # Daily at noon UCT
- cron: "0 12 * * *" # Daily at noon UTC

env:
KACHERY_CLOUD_CLIENT_ID: ${{ secrets.KACHERY_CLOUD_CLIENT_ID }}
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Get current year-month
id: date
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache/restore@v3
id: cache-venv
with:
path: ~/test_env
Expand All @@ -34,24 +34,22 @@ jobs:
sudo apt update
# this is for datalad and download testing datasets
sudo apt install git
# this is for spyking circus
# sudo apt install mpich libmpich-dev
# needed for correct operation of git/git-annex/DataLad
git config --global user.email "[email protected]"
git config --global user.name "CI Almighty"
# this is for spyking circus
# sudo apt install mpich libmpich-dev
# create an environement (better for caching)
python -m venv ~/test_env
source ~/test_env/bin/activate
python -m pip install -U pip # Official recommended way
pip install setuptools wheel twine
source ~/test_env/bin/activate
pip install tabulate # This produces summaries at the end
## clean some cache to avoid using old cache
pip cache remove numpy
pip cache remove hdbscan
pip cache remove numba
# herdingspikes need numpy to installed first, this numpy pre install will be removed when HS remove from testing
pip install numpy==1.22
pip install -e .[test,extractors,full]
pip install tabulate
- name: git-annex install
run: |
wget https://downloads.kitenet.net/git-annex/linux/current/git-annex-standalone-amd64.tar.gz
Expand All @@ -69,7 +67,7 @@ jobs:
id: vars
run: |
echo "HASH_EPHY_DATASET=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache/restore@v3
id: cache-datasets
env:
# the key depend on the last comit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/full-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Full spikeinterface tests

on:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
types: [synchronize, opened, reopened]

concurrency: # Cancel previous workflows on the same pull request
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
env: # For the sortingview backend
KACHERY_CLOUD_CLIENT_ID: ${{ secrets.KACHERY_CLOUD_CLIENT_ID }}
KACHERY_CLOUD_PRIVATE_KEY: ${{ secrets.KACHERY_CLOUD_PRIVATE_KEY }}

Expand All @@ -29,11 +29,13 @@ jobs:
- name: Get current year-month
id: date
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache/restore@v3
id: cache-venv
with:
path: ~/test_env
key: ${{ runner.os }}-venv-${{ hashFiles('**/pyproject.toml') }}-${{ steps.date.outputs.date }}
restore-keys: |
${{ runner.os }}-venv-
- name: Python version
run: |
python --version
Expand All @@ -42,16 +44,14 @@ jobs:
sudo apt update
# this is for datalad and download testing datasets
sudo apt install git
# this is for spyking circus
# sudo apt install mpich libmpich-dev
# needed for correct operation of git/git-annex/DataLad
git config --global user.email "[email protected]"
git config --global user.name "CI Almighty"
# this is for spyking circus
# sudo apt install mpich libmpich-dev
# create an environement (better for caching)
python -m venv ~/test_env
source ~/test_env/bin/activate
python -m pip install -U pip # Official recommended way
pip install setuptools wheel twine
source ~/test_env/bin/activate
pip install tabulate # This produces summaries at the end
## clean some cache to avoid using old cache
pip cache remove numpy
Expand All @@ -77,7 +77,7 @@ jobs:
id: vars
run: |
echo "HASH_EPHY_DATASET=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache/restore@v3
id: cache-datasets
env:
# the key depend on the last comit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.9'
- name: Install dependencies for testing
run: |
python -m pip install -U pip # Official recommended way
pip install pytest
pip install zarr
pip install setuptools wheel twine build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/s3-nwb-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: S3 NWB Test
on:
pull_request:
branches: [master]
types: [synchronize, opened, reopened, ready_for_review]
types: [synchronize, opened, reopened]

concurrency: # Cancel previous workflows on the same pull request
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down

0 comments on commit ed9f3f5

Please sign in to comment.