-
Notifications
You must be signed in to change notification settings - Fork 76
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
test: Emscripten build and test on GitHub Actions #1026
Closed
Closed
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
40580c9
add GitHub actions workflow for emscripten build
lobis dbaa7c8
run tests
lobis e1e7c12
install only pytest
lobis ac53a5f
Merge branch 'main' into emscripten-ci
lobis b8ad995
add emscripten test marker
lobis 51b5a2c
increase awkward version to fix dependency resolution conflict
lobis 285c179
build awkward wheel
lobis 489fadc
move wheel
lobis e1b8bcb
Update .github/workflows/emscripten.yml
lobis 26dd2c5
Merge remote-tracking branch 'origin/main' into emscripten-ci
lobis 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,68 @@ | ||
name: Emscripten build and test | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install pyodide-build | ||
run: | | ||
pip install pyodide-build | ||
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV | ||
|
||
- name: Setup Emscripten | ||
uses: mymindstorm/setup-emsdk@v12 | ||
with: | ||
version: ${{ env.EMSCRIPTEN_VERSION }} | ||
|
||
- name: Build | ||
run: pyodide build | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
# clone awkward and build a wheel, copy the wheel | ||
- name: Awkward wheel | ||
run: | | ||
git clone https://github.com/scikit-hep/awkward.git | ||
cd awkward | ||
git checkout main | ||
git submodule update --init --recursive | ||
pyodide build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
mv dist/*.whl ../dist | ||
|
||
- name: Set up Pyodide virtual environment | ||
run: | | ||
pyodide venv .venv-pyodide | ||
source .venv-pyodide/bin/activate | ||
# python -m pip install .[test] | ||
python -m pip install pytest | ||
ls -l dist | ||
python -m pip install dist/*.whl | ||
python -c "import sys; print(sys.platform)" | ||
|
||
- name: Test | ||
run: | | ||
source .venv-pyodide/bin/activate | ||
python -m pytest -vv tests -m emscripten --reruns 3 --reruns-delay 30 --only-rerun "(?i)http|timeout|connection" |
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
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
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 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.
n.b. you'll still need awkward's C++ components too
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.
My initial goal was to test the build (only uproot) and run the tests. However the uproot build will only work if the dependencies (awkward) are available, and there is a significant delay between the publication in pypi and it's availability from pyodide, this means that this CI will fail for a while whenever there is a release that modifies dependencies.
To test the CI job I though of building the awkward (and awkward-cpp) wheel in this CI job (in particular the version of awkward listed in pyproject.toml).
I am having some troubles understanding the necessary steps though.