Fix: Error #930
Workflow file for this run
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
--- | |
# yamllint disable rule:line-length | |
name: fake-bpy-module CI | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches: | |
- master | |
- 'run-ci/**' | |
pull_request: | |
release: | |
types: | |
- released | |
jobs: | |
set_versions: | |
name: Set build versions | |
runs-on: ubuntu-latest | |
outputs: | |
module_version: ${{ steps.set_module_version.outputs.module_version }} | |
file_version: ${{ steps.set_file_version.outputs.file_version }} | |
steps: | |
# Use ISO 8601 date (in UTC) + timestamp (in UTC) | |
- name: Create generic module version | |
run: echo "MODULE_VERSION=$(date -u +%Y%m%d).dev$(date -u +%H%M%S)" >> $GITHUB_ENV | |
# Use the tag name for a release | |
- name: Override release module version | |
if: github.event_name == 'release' | |
run: echo "MODULE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
# Add addtional git sha ref | |
- name: Override PR module version | |
if: github.event_name == 'pull_request' | |
run: echo "MODULE_VERSION=${MODULE_VERSION}+${GITHUB_SHA::8}" >> $GITHUB_ENV | |
# Set module version output | |
- name: Set module version | |
id: set_module_version | |
run: echo ::set-output name=module_version::${MODULE_VERSION} | |
# Use ISO 8601 timestamps (in UTC) for output/file version | |
- name: Set file version | |
id: set_file_version | |
run: echo ::set-output name=file_version::$(date -u +%Y%m%dT%H%M%SZ) | |
build_modules: | |
name: Build modules | |
runs-on: ubuntu-latest | |
needs: [set_versions] | |
strategy: | |
fail-fast: false | |
matrix: | |
blender_version: | |
[ | |
"2.78", "2.79", | |
"2.80", "2.81", "2.82", "2.83", | |
"2.90", "2.91", "2.92", "2.93", | |
"3.0", "3.1", "3.2", "3.3", "3.4" | |
] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.7" | |
- name: Blender downloads cache | |
uses: actions/cache@v2 | |
id: blender-bin-cache | |
with: | |
path: blender-bin | |
key: blender-binaries-${{ runner.os }}-${{ matrix.blender_version }}-${{ hashFiles('**/tools/utils/download_blender.sh') }} | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Test fake_bpy_module core module | |
run: bash tests/run_pre_tests.sh src | |
- name: Install Blender binary dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y libglu1-mesa | |
- name: Install fake-bpy-module tools | |
run: sudo apt install -y pandoc | |
- name: Download Blender files | |
if: steps.blender-bin-cache.outputs.cache-hit != 'true' | |
run: bash tools/utils/download_blender.sh ${{ matrix.blender_version }} blender-bin | |
# alternatively to the github checkout, you can also use | |
# git.blender.org. See below. | |
- name: Checkout Blender from Github | |
uses: actions/checkout@v2 | |
with: | |
repository: "blender/blender" | |
path: blender | |
- name: Generate pip Packages | |
env: | |
RELEASE_VERSION: ${{ needs.set_versions.outputs.module_version }} | |
run: bash tools/pip_package/build_pip_package.sh release blender ${{ matrix.blender_version }} ./blender ./blender-bin/blender-v${{ matrix.blender_version }}-bin ${{ matrix.blender_version }} | |
- name: Archive pip packages | |
uses: actions/upload-artifact@v2 | |
with: | |
name: fake_bpy_modules_${{ matrix.blender_version}}_pip_${{ needs.set_versions.outputs.file_version }} | |
path: release | |
- name: Archive raw modules | |
uses: actions/upload-artifact@v2 | |
with: | |
name: fake_bpy_modules_${{ matrix.blender_version}}_raw_${{ needs.set_versions.outputs.file_version }} | |
path: "raw_modules/fake_bpy_module*" | |
- name: Test Generated Modules | |
run: bash tests/run_tests.sh raw_modules | |
- name: Test generated pip module against Cycles addon | |
# Using a wildcard instead of | |
# ${{ needs.set_versions.outputs.module_version }} below, because the | |
# pip filenames do not respect leading zeros: | |
# | |
# For example: 00:29:45 UTC will create a file version | |
# "...dev2945-py3-none..." and not use {{ module_version }} | |
# "...dev002945-py3-none..." | |
run: bash tests/pylint_cycles.sh blender ${{ matrix.blender_version }} ./blender/ ./release/${{ matrix.blender_version }}/fake_bpy_module_${{ matrix.blender_version }}-*-py3-none-any.whl | |
- name: Collect failure state | |
if: failure() | |
run: bash tools/collect_failure_state/collect_failure_state.sh /tmp/failure_state_${{ matrix.blender_version}} | |
- name: Store failure state | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: failure_state_${{ matrix.blender_version}} | |
path: /tmp/failure_state_${{ matrix.blender_version}} | |
pypi_release_test: | |
name: PyPI Release test | |
needs: [build_modules] | |
if: github.event_name != 'pull_request' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
blender_version: | |
[ | |
"2.78", "2.79", | |
"2.80", "2.81", "2.82", "2.83", | |
"2.90", "2.91", "2.92", "2.93", | |
"3.0", "3.1", "3.2", "3.3", "3.4" | |
] | |
steps: | |
- name: Fetch artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: dist | |
# Publish to TestPyPi on each merge to master | |
- name: Publish distribution 📦 to Test PyPI | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.test_pypi_token }} | |
repository_url: https://test.pypi.org/legacy/ | |
packages_dir: "dist/fake_bpy_modules_${{ matrix.blender_version }}_pip_*/*/" | |
pypi_release: | |
name: PyPI Release fake-bpy-module | |
needs: [pypi_release_test] | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
blender_version: | |
[ | |
"2.78", "2.79", | |
"2.80", "2.81", "2.82", "2.83", | |
"2.90", "2.91", "2.92", "2.93", | |
"3.0", "3.1", "3.2", "3.3", "3.4" | |
] | |
steps: | |
- name: Fetch Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: dist | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.pypi_token }} | |
packages_dir: "dist/fake_bpy_modules_${{ matrix.blender_version }}_pip_*/*/" | |
upload_github_release_assets: | |
name: Upload Artifacts to GitHub Release | |
needs: [pypi_release_test] | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
blender_version: | |
[ | |
"2.78", "2.79", | |
"2.80", "2.81", "2.82", "2.83", | |
"2.90", "2.91", "2.92", "2.93", | |
"3.0", "3.1", "3.2", "3.3", "3.4" | |
] | |
steps: | |
- name: Fetch Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: dist | |
- name: Store Asset Information | |
run: | | |
export FAKE_BPY_MODULE_FILEPATH=$(ls -1 dist/fake_bpy_modules_${{ matrix.blender_version }}_raw_*/*.zip | head -n 1) && echo ${FAKE_BPY_MODULE_FILEPATH} | |
echo "FAKE_BPY_MODULE_FILEPATH=${FAKE_BPY_MODULE_FILEPATH}" >> $GITHUB_ENV | |
echo "FAKE_BPY_MODULE_FILENAME=$(basename "${FAKE_BPY_MODULE_FILEPATH}")" >> $GITHUB_ENV | |
echo "MIME_TYPE=$(file --mime-type -b "${FAKE_BPY_MODULE_FILEPATH}")" >> $GITHUB_ENV | |
- name: Upload ${{ matrix.blender_version }} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN_FOR_ACTIONS }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{ env.FAKE_BPY_MODULE_FILEPATH }} | |
asset_name: ${{ env.FAKE_BPY_MODULE_FILENAME }} | |
asset_content_type: ${{ env.MIME_TYPE }} |