-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CI for testing pyflask distributable #297
Merged
Merged
Changes from 3 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0a0b4b0
Create pyflask-build-and-dist-tests.yml
CodyCBakerPhD fb98ceb
try to trigger for testing
CodyCBakerPhD fdcd06e
no dice
CodyCBakerPhD 1d04e1f
Merge branch 'simpler_flask_reduction' into ci_tests_for_flask_builds_2
CodyCBakerPhD 03362c6
Merge branch 'main' into ci_tests_for_flask_builds_2
CodyCBakerPhD 310761f
fix typo
CodyCBakerPhD 5595bc0
single quotes
CodyCBakerPhD 0e69c25
fix mamba env reference
CodyCBakerPhD 2d3bd1f
restore env path base
CodyCBakerPhD 96e7371
Merge branch 'main' into ci_tests_for_flask_builds_2
CodyCBakerPhD 2b5afc6
try update on the file
CodyCBakerPhD 9522bc1
add error throws
CodyCBakerPhD 3377271
suppress build test parsing error
CodyCBakerPhD 01d94cb
Close main process gracefully on success
garrettmflynn c3cbf45
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a68ca01
Merge branch 'main' into ci_tests_for_flask_builds_2
CodyCBakerPhD 6fe9a06
Try catching cumulative errors
garrettmflynn bbe4517
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: PyFlask build and distributable 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: PyFlask build and distributable tests on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
include: | ||
- python-version: "3.9" | ||
os: ubuntu-latest | ||
label: environments/environment-Linux.yml | ||
prefix: /usr/share/miniconda3/envs/nwb-guide | ||
shorthand: unix | ||
|
||
- python-version: "3.10" | ||
os: macos-latest | ||
label: environments/environment-Mac.yml | ||
prefix: /Users/runner/miniconda3/envs/nwb-guide | ||
shorthand: unix | ||
|
||
- python-version: "3.9" | ||
os: windows-latest | ||
label: environments/environment-Windows.yml | ||
prefix: C:\Miniconda3\envs\nwb-guide | ||
shorthand: win | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: git fetch --prune --unshallow --tags | ||
|
||
# see https://github.com/conda-incubator/setup-miniconda#caching-environments | ||
- name: Setup Mambaforge | ||
uses: conda-incubator/setup-miniconda@v2 | ||
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@v2 | ||
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: ${{ CACHE_NUMBER }} | ||
id: cache | ||
|
||
- if: steps.cache.outputs.cache-hit != 'true' | ||
name: Update environment | ||
run: mamba env update -n env-electron-python -f ${{ matrix.label }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
|
||
- name: Build PyFlask distribution | ||
run: npm run build:flask:${{ matrix.shorthand }} | ||
|
||
- if: matrix.os == "windows-latest" | ||
name: Run test on build executable | ||
run: node tests/testPyinstallerExecutable.js ./build/nwb-guide/nwb-guide.exe | ||
|
||
- if: matrix.os != "windows-latest" | ||
name: Run test on build executable | ||
run: node tests/testPyinstallerExecutable.js ./build/nwb-guide/nwb-guide | ||
|
||
- name: Run test on distributed executable | ||
run: node tests/testPyinstallerExecutable.js | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was some confusion on my part about this - after double checking the flags to
pyinstaller
, I see that the default path of your tests is indeed the 'distributable' (./build/flask/nwb-guide/nwb-guide.exe
) and not the 'build' (./build/nwb-guide/nwb-guide.exe
)I've simply added the tests on the build, as PyInstaller refers to them, to be exhaustive in case there ever could be any difference between the two
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sure. For some reason, I'd thought you meant that you'd target the
dist/mac/NWB GUIDE.app/Contents/Resources/nwb-guide/nwb-guide
file that is produced after copying the distributable file to the Electron app.TBH I'm never touching the 'build' version, which is contained in a folder that primarily contains Pyinstaller logs, so we might just ignore it since it's unused.