mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
fc97ccb6dc
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: '7'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 62f627ecc6)
102 lines
3.3 KiB
YAML
102 lines
3.3 KiB
YAML
name: Build IfcOpenShell WASM / Pyodide
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build_ifcopenshell:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v7
|
|
with:
|
|
submodules: recursive
|
|
path: IfcOpenShell
|
|
|
|
- name: Checkout Build Repository
|
|
uses: actions/checkout@v7
|
|
with:
|
|
repository: IfcOpenShell/build-outputs
|
|
path: ifcopenshell_build
|
|
ref: wasm
|
|
lfs: true
|
|
token: ${{ secrets.BUILD_REPO_TOKEN }}
|
|
|
|
- name: Unpack Dependencies
|
|
run: |
|
|
cd ifcopenshell_build
|
|
python ../IfcOpenShell/nix/cache_dependencies.py unpack
|
|
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2.23
|
|
with:
|
|
key: ubuntu-22.04-${{ runner.arch }}
|
|
|
|
- name: Build
|
|
run: |
|
|
./IfcOpenShell/pyodide/build_pyodide.sh
|
|
FILE=`echo dist/ifcopenshell-*.whl`
|
|
NEW_FILE=`echo $FILE | sed "s/-/+${GITHUB_SHA:0:7}-/2"`
|
|
mv $FILE $NEW_FILE
|
|
|
|
- name: Order wheel shared objects
|
|
run: |
|
|
python ./IfcOpenShell/pyodide/order_pyodide_wheel_shared_objects.py dist/ifcopenshell-*.whl
|
|
|
|
- name: Split packages
|
|
run: |
|
|
VERSION=v`cat ./IfcOpenShell/VERSION`
|
|
mkdir -p dist-modular
|
|
python ./IfcOpenShell/pyodide/split_pyodide_ifcopenshell_wheel.py dist/ifcopenshell-*.whl ./dist-modular
|
|
cd dist-modular
|
|
zip -r -qq ifcopenshell-modular-${VERSION}-${GITHUB_SHA:0:7}-pyodide.zip *.whl
|
|
|
|
- name: Upload Build Logs
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: build-logs-pyodide
|
|
path: |
|
|
ifcopenshell_build/*/*/logs/*.log
|
|
retention-days: 30
|
|
|
|
- name: Run wheel tests
|
|
run: |
|
|
cp -r IfcOpenShell/pyodide/test test
|
|
# venv set up in build_pyodide.sh.
|
|
source .venv/bin/activate
|
|
uv pip install pytest-pyodide
|
|
PYODIDE_ROOT_DIST=`pyodide config get pyodide_root`/dist
|
|
# `pytest-pyodide` requires pyodide in 'pyodide' directory in cwd, when running `pytest`.
|
|
cp -r $PYODIDE_ROOT_DIST test/pyodide
|
|
cp dist/ifcopenshell-*.whl test/pyodide
|
|
cd test
|
|
pytest --capture=no
|
|
|
|
- name: Pack Dependencies
|
|
run: |
|
|
cd ifcopenshell_build
|
|
python ../IfcOpenShell/nix/cache_dependencies.py pack
|
|
|
|
- name: Commit and Push Changes to Build Repository
|
|
run: |
|
|
cd ifcopenshell_build
|
|
git config user.name "IfcOpenBot"
|
|
git config user.email "ifcopenbot@ifcopenshell.org"
|
|
git add */*/install/cache-*.tar.gz
|
|
git commit -m "Update build artifacts [skip ci]" || echo "No changes to commit"
|
|
git push || echo "Push failed"
|
|
|
|
- name: Configure AWS credentials
|
|
uses: aws-actions/configure-aws-credentials@v6
|
|
with:
|
|
aws-access-key-id: ${{ secrets.AWS_UPLOAD_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.AWS_UPLOAD_SECRET_ACCESS_KEY }}
|
|
aws-region: us-east-1
|
|
|
|
- name: Upload .zip archives to S3
|
|
run: |
|
|
aws s3 cp dist s3://ifcopenshell-builds/ --recursive --exclude "*" --include "*.whl"
|
|
aws s3 cp dist-modular s3://ifcopenshell-builds/ --recursive --exclude "*" --include "*.zip"
|