Skip to content

#3 - Test PR with non-corrupt STLs #53

#3 - Test PR with non-corrupt STLs

#3 - Test PR with non-corrupt STLs #53

Workflow file for this run

name: VoronCI PR Test CI
run-name: "#${{github.event.number}} - ${{github.event.pull_request.title}}"
on:
pull_request:
types: [opened, reopened, synchronize, labeled]
env:
VORON_TOOLKIT_OUTPUT_DIR: ${{ github.workspace }}/workflow_output
VORON_TOOLKIT_INPUT_DIR: ${{ github.workspace }}/tests/test_repository_root/printer_mods
VORON_TOOLKIT_GH_STEP_SUMMARY: true
VORON_TOOLKIT_VERBOSE: true
jobs:
voron_ci_dismiss_labels:
# If the PR was opened, reopened or new commits were pushed, dismiss all labels during post processing
if: ${{ github.event_name == 'pull_request' && github.event.action != 'labeled' }}
runs-on: ubuntu-latest
steps:
- name: Dismiss all CI labels 🚮
id: dismiss-labels
run: |
mkdir -p ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}
echo -n '{"pr_number": ${{ github.event.number }}, "action": "dismiss_labels"}' > ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}/ci_result.json
echo -n ${{ toJson(github.event) }} > ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}/ci_event.json
# Upload Artifact
- name: Upload build artifacts 📦
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
with:
name: ci_output
path: ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}
voron_ci_skip:
# The PR was labeled with any label OTHER than "Ready for CI", which means we should skip the CI run and the post processing
if: ${{ github.event_name == 'pull_request' && github.event.action == 'labeled' && !contains( github.event.pull_request.labels.*.name, 'Ready for CI')}}
runs-on: ubuntu-latest
steps:
- name: Skip CI ⏩
id: skip-ci
run: |
mkdir -p ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}
echo -n '{"pr_number": ${{ github.event.number }}, "action": "skip"}' > ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}/ci_result.json
echo -n ${{ toJson(github.event) }} > ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}/ci_event.json
# Upload Artifact
- name: Upload build artifacts 📦
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
with:
name: ci_output
path: ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}
voron_ci:
# The PR was labeled with the "Ready for CI label", which menas we should run the CI and post processing
if: ${{ github.event_name == 'pull_request' && github.event.action == 'labeled' && contains( github.event.pull_request.labels.*.name, 'Ready for CI')}}
runs-on: ubuntu-latest
steps:
- id: changed-files
if: ${{ !cancelled() }}
name: Get changed files 🔀
# Check out files, separate with newlines to catch whitespace in filenames
uses: tj-actions/changed-files@v37
with:
separator: "\n"
# Sanitize the file list
- name: Prepare Sparse Checkout 🧹
if: ${{ !cancelled() }}
id: sanitize_file_list
uses: docker://ghcr.io/vorondesign/voron_toolkit_docker:latest
env:
SPARSE_CHECKOUT_HELPER_INPUT: ${{ steps.changed-files.outputs.all_changed_files }}
with:
args: prepare-sparse-checkout
- name: Perform sparse checkout ↪️
if: ${{ !cancelled() }}
# Perform a sparse checkout, checking out only the files of the PR
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
ref: ${{ github.ref }}
path: ${{ github.workspace }}
sparse-checkout: ${{ steps.sanitize_file_list.outputs.SPARSE_CHECKOUT_HELPER_OUTPUT }}
sparse-checkout-cone-mode: false
- name: Save PR number 💾
id: run-ci
run: |
mkdir -p ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}
echo -n '{"pr_number": ${{ github.event.number }}, "action": "post_process"}' > ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}/ci_result.json
echo -n ${{ toJson(github.event) }} > ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}/ci_event.json
# Run whitespace/licenses/file sizes based on files in the test directory
- name: Check files for whitespace/licenses/file sizes 🔍
if: ${{ !cancelled() }}
uses: docker://ghcr.io/vorondesign/voron_toolkit_docker:latest
env:
FILE_CHECKER_IGNORE_WARNINGS: true
FILE_CHECKER_CHECK_LICENSE: true
FILE_CHECKER_CHECK_FILE_SIZE_MB: 2
with:
args: check-files
- name: Check correct mod/file structure 🔍
if: ${{ !cancelled() }}
uses: docker://ghcr.io/vorondesign/voron_toolkit_docker:latest
env:
MOD_STRUCTURE_CHECKER_IGNORE_WARNINGS: false
with:
args: check-mod-structure
# Run the corruption checker
- name: Check for STL corruption 🔍
if: ${{ !cancelled() }}
uses: docker://ghcr.io/vorondesign/voron_toolkit_docker:latest
env:
CORRUPTION_CHECKER_IGNORE_WARNINGS: true
with:
args: check-stl-corruption
# Run the rotation checker
- name: Check for incorrect STL rotation 🔍
if: ${{ !cancelled() }}
uses: docker://ghcr.io/vorondesign/voron_toolkit_docker:latest
env:
ROTATION_CHECKER_IGNORE_WARNINGS: true
ROTATION_CHECKER_IMAGEKIT_ENDPOINT: https://ik.imagekit.io/vorondesign
ROTATION_CHECKER_IMAGEKIT_SUBFOLDER: ci_${{github.event.number}}
with:
args: check-stl-rotation
# Generate a README
- name: Generate README 📒
if: ${{ !cancelled() }}
uses: docker://ghcr.io/vorondesign/voron_toolkit_docker:latest
env:
README_GENERATOR_MARKDOWN: false
README_GENERATOR_JSON: false
with:
args: generate-readme
# Upload Artifact
- name: Upload build artifacts 📦
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
if: '!cancelled()'
with:
name: ci_output
path: ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}