Skip to content

Commit

Permalink
make specific workflow for dev server tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD authored May 22, 2024
1 parent c8ca5b4 commit 60e3409
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/flask_dev_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Flask Dev Tests
on:
schedule:
- cron: "0 17 * * *" # Daily at 1pm EST
pull_request:
workflow_dispatch:

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

env:
CACHE_NUMBER: 1 # increase to reset cache manually

jobs:
testing:
name: ${{ matrix.os }} # Will read on the dashboard as 'Flask Dev Tests / {os}'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false
matrix:
include:
# current linux installation instructions use dev mode instead of distributable
# - python-version: "3.9"
# os: ubuntu-latest
# label: environments/environment-Linux.yml
# prefix: /usr/share/miniconda3/envs/nwb-guide

- python-version: "3.9"
os: macos-latest # Mac arm64 runner
label: environments/environment-MAC-apple-silicon.yml
prefix: /Users/runner/miniconda3/envs/nwb-guide

- python-version: "3.9"
os: macos-13 # Mac x64 runner
label: environments/environment-MAC-intel.yml
prefix: /Users/runner/miniconda3/envs/nwb-guide

- python-version: "3.9"
os: windows-latest
label: environments/environment-Windows.yml
prefix: C:\Miniconda3\envs\nwb-guide

steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow --tags

- name: Printout architecture
run: uname -m

# see https://github.com/conda-incubator/setup-miniconda#caching-environments
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: nwb-guide
use-mamba: true

- name: Set cache date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Mamba env
uses: actions/cache@v4
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}-${{ runner.arch }}-${{steps.get-date.outputs.today }}-${{ hashFiles(matrix.label) }}-${{ env.CACHE_NUMBER }}
env:
CACHE_NUMBER: ${{ env.CACHE_NUMBER }}
id: cache

- if: steps.cache.outputs.cache-hit != 'true'
name: Update environment
run: mamba env update -f ${{ matrix.label }}

- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"

- run: npm ci --verbose

- name: Run Python tests on local dev mode
run: npm run test:server

0 comments on commit 60e3409

Please sign in to comment.