-
Notifications
You must be signed in to change notification settings - Fork 3
94 lines (77 loc) · 2.8 KB
/
pyflask-build-and-dist-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build Tests
on:
schedule:
- cron: "0 16 * * *" # Daily at noon 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: PyInstaller on ${{ matrix.os }} # Will read on the dashboard as 'Build Tests / PyInstaller on {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
label: environments/environment-Mac.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
# 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
# fix for macos build
- if: matrix.os == 'macos-latest'
run: rm -f /Users/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/sonpy/linux/sonpy.so
- name: Build PyFlask distribution
run: npm run build:flask
- name: Run test on distributed executable
run: node tests/testPyinstallerExecutable.js
- name: Run Python tests on distributed executable
run: npm run test:executable