mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
17b88fff22
Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 5 to 6. - [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases) - [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/v5...v6) --- updated-dependencies: - dependency-name: aws-actions/configure-aws-credentials dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
89 lines
2.7 KiB
YAML
89 lines
2.7 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@v6
|
|
with:
|
|
submodules: recursive
|
|
path: IfcOpenShell
|
|
|
|
- name: Checkout Build Repository
|
|
uses: actions/checkout@v6
|
|
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/pyodide/cache_dependencies.py unpack
|
|
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
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: Upload Build Logs
|
|
if: always()
|
|
uses: actions/upload-artifact@v6
|
|
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/pyodide/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"
|