#28 - fix paths and resolution for generated pngs from blender #481
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
name: Render previews | |
on: | |
push: | |
paths: | |
- '**.scad' | |
- '**.ini' | |
branches: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
OPENSCAD_BIN: xvfb-run --auto-servernum ~/OpenSCAD.AppImage | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GITHUBPAT }} | |
submodules: recursive | |
- name: Checkout repository and set original GitHub token | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ github.token }} | |
- name: Install requirements | |
run: | | |
uname -p | |
sudo apt update | |
sudo apt-get install libc-bin python3-setuptools xvfb | |
# HOW TO SPEED UP | |
# processor3d now can call it # FIXME: maybe we should prepare image for run multiple action instead of | |
# install requirements again in every job! | |
# see: https://docs.docker.com/build/ci/github-actions/share-image-jobs/ | |
# even better reuse artifact (runner image) from previous run | |
# see: https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts | |
sudo apt-get install blender | |
sudo python3 -m pip install --upgrade pip | |
sudo python3 -m pip install stlsort lxml | |
sudo python3 -m pip install git+https://github.com/ThunderFly-aerospace/yagv | |
sudo python3 -m pip install git+https://${{ secrets.AUTH_USER }}:${{ secrets.GITHUBPAT }}@github.com/ThunderFly-aerospace/processor3D.git@blender | |
wget https://files.openscad.org/OpenSCAD-2021.01-x86_64.AppImage -O ~/OpenSCAD.AppImage | |
chmod +x ~/OpenSCAD.AppImage | |
~/OpenSCAD.AppImage --version | |
- name: Clean repo | |
run: | | |
rm CAD/png/*.png ||: | |
rm CAD/stl/*.stl ||: | |
rm CAD/amf/*.amf ||: | |
- name: Make -d CAD/src | |
run: | | |
cd CAD/src | |
make | |
- name: Make -d CAD/src/assembly/position | |
run: | | |
cd CAD/src/assembly/position | |
make | |
- name: Make -d CAD/src/assembly | |
run: | | |
cd CAD/src/assembly | |
make | |
- name: Make -d CAD/src/assembly (test blender) | |
run: | | |
cd CAD/src/assembly/test | |
make | |
- name: Upload a PNG Artifact | |
uses: actions/[email protected] | |
with: | |
name: 'render_png' | |
path: './**/*.png' | |
- name: Upload a STL Artifact | |
uses: actions/[email protected] | |
with: | |
name: 'render_stl' | |
path: './**/*.stl' | |
- name: publish to git | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Automatic commit from workflow | |
Update_blender: | |
needs: build | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
# with: | |
# token: ${{ secrets.GITHUBPAT }} | |
# submodules: recursive | |
# | |
# - name: Checkout repository and set original GitHub token | |
# uses: actions/checkout@v2 | |
# with: | |
# token: ${{ github.token }} | |
- name: install blender | |
run: | | |
sudo apt update | |
sudo apt-get install blender | |
- name: Update blender | |
run: | | |
cd CAD/blender | |
./update_blend_file.sh | |
- name: Checkout repository and set original GitHub token | |
uses: actions/checkout@v2 | |
- name: publish to git | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Automatic commit from workflow | |