-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (113 loc) · 4.55 KB
/
test_pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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
GITHUB_EVENT_CONTEXT: ${{ toJson(github.event) }}
jobs:
voron_ci_skip:
if: ${{ github.event.action != 'labeled' || !contains( github.event.pull_request.labels.*.name, 'Ready for CI')}}
runs-on: ubuntu-latest
steps:
- name: Save Github Event Payload 💾
id: save-payload
run: |
mkdir -p ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}
echo -n "$GITHUB_EVENT_CONTEXT" >> ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}/event.json
# Upload Artifact
- name: Upload build artifacts 📦
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
if: '!cancelled()'
with:
name: ci_output
path: ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}
voron_ci:
if: ${{ 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 Github Event Payload💾
id: save-payload
run: |
mkdir -p ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}
echo -n "$GITHUB_EVENT_CONTEXT" >> ${{ env.VORON_TOOLKIT_OUTPUT_DIR }}/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 }}