Add updates for reusable workflows v3

This commit is contained in:
Florian Heilmann 2023-07-18 00:12:46 +02:00
parent d6d64ade76
commit 70370e345a
3 changed files with 38 additions and 27 deletions

13
.github/workflows/create_pr_comment.yml vendored Normal file
View File

@ -0,0 +1,13 @@
on:
workflow_run:
workflows: ["VoronUsers PR CI"]
types:
- completed
jobs:
create_pr_comment:
permissions:
pull-requests: write
name: Create PR comment and assign labels
if: ${{ github.event.workflow_run.event == 'pull_request' }}
uses: VoronDesign/.github/.github/workflows/pr-comment-labels.yml@v3

View File

@ -11,7 +11,7 @@ permissions:
jobs:
checkout_check_whitespace:
name: Checkout & Check Whitespace
uses: VoronDesign/.github/.github/workflows/pr_checkout_check_whitespace_cache.yml@v2
uses: VoronDesign/.github/.github/workflows/pr_checkout_check_whitespace_cache.yml@v3
with:
branch: ${{ github.ref }}
cache-key: file-cache-${{github.sha}}
@ -20,7 +20,7 @@ jobs:
needs: [checkout_check_whitespace]
name: Prepare python environment
if: ${{ needs.checkout_check_whitespace.outputs.stl == 'true' }}
uses: VoronDesign/.github/.github/workflows/prepare-environment.yml@v2
uses: VoronDesign/.github/.github/workflows/prepare-environment.yml@v3
with:
apt-packages: "admesh, libadmesh-dev"
pip-packages: "admesh imagekitio git+https://github.com/ChristophSchranz/Tweaker-3.git"
@ -29,7 +29,7 @@ jobs:
name: Check STL corruption
needs: [setup_python]
if: ${{ needs.checkout_check_whitespace.outputs.stl == 'true' }}
uses: VoronDesign/.github/.github/workflows/check-stl-corruption.yml@v2
uses: VoronDesign/.github/.github/workflows/check-stl-corruption.yml@v3
with:
cache-key: file-cache-${{github.sha}}
cache-directory: pr-files
@ -38,7 +38,7 @@ jobs:
name: Check STL rotation
needs: [setup_python]
if: ${{ needs.checkout_check_whitespace.outputs.stl == 'true' }}
uses: VoronDesign/.github/.github/workflows/check-stl-rotation.yml@v2
uses: VoronDesign/.github/.github/workflows/check-stl-rotation.yml@v3
secrets:
# ToDo: Change to secrets: inherit once it's in the VoronDesign org
IMAGEKIT_PRIVATE_KEY: ${{ secrets.IMAGEKIT_PRIVATE_KEY }}
@ -52,34 +52,33 @@ jobs:
name: Check metadata files
needs: [checkout_check_whitespace]
if: ${{ needs.checkout_check_whitespace.outputs.yaml == 'true' }}
uses: VoronDesign/.github/.github/workflows/validate-metadata-files.yml@v2
uses: VoronDesign/.github/.github/workflows/validate-metadata-files.yml@v3
with:
cache-key: file-cache-${{github.sha}}
cache-directory: pr-files
preview_readme:
name: Preview README.md
needs: [validate_metadata]
uses: VoronDesign/.github/.github/workflows/preview-readme.yml@v2
uses: VoronDesign/.github/.github/workflows/preview-readme.yml@v3
with:
subdirectory: printer_mods
cache-key: file-cache-${{github.sha}}
cache-directory: pr-files
create_pro_comment:
name: Create PR comment
prepare_pr_comment:
name: Store PR comment parameters
# The create_pr_common workflow listens for completion of this workload and executes.
# This allows us to run in the context of our repo, with sufficient credentials to do PR comments/set labels. We pass the
# information that the dispatched workflow can't deduce on its own via an uploaded artifact
needs: [checkout_check_whitespace, check_stls, check_stl_rotation, validate_metadata, preview_readme]
if: ${{ always() }}
uses: VoronDesign/.github/.github/workflows/generate-pr-comment.yml@v2
runs-on: ubuntu-latest
steps:
- name: Save PR number
run: |
mkdir -p ${{ runner.temp }}/pr
echo -n ${{ github.event.number }} > ${{ runner.temp }}/pr/pr_number
echo -n ${{ github.run_id }} > ${{ runner.temp }}/pr/action_run_id
- uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
with:
repository: ${{ github.repository }}
action_run_id: ${{ github.run_id }}
# check_files:
# name: Check files
# needs: [validate_metadata]
# uses: VoronDesign/.github/.github/workflows/validate_files.yml@v1
# with:
# subdirectory: printer_mods
# cache-key: file-cache-${{github.sha}}
# cache-directory: pr-files
# python-cache-key: voronusers-python-cache
name: pr
path: ${{ runner.temp }}/pr

View File

@ -6,14 +6,14 @@ on:
jobs:
setup_python:
name: Rebuild repo caches
uses: VoronDesign/.github/.github/workflows/prepare-environment.yml@v2
uses: VoronDesign/.github/.github/workflows/prepare-environment.yml@v3
with:
apt-packages: "admesh, libadmesh-dev"
pip-packages: "admesh imagekitio git+https://github.com/ChristophSchranz/Tweaker-3.git"
python-cache-key: voronusers-python-cache
preview_readme:
name: Generate README
uses: VoronDesign/.github/.github/workflows/generate-readme.yml@v2
uses: VoronDesign/.github/.github/workflows/generate-readme.yml@v3
with:
subdirectory: printer_mods
commit_msg: "Generate VoronUsers printer_mods README.md [skip ci]"
@ -21,4 +21,3 @@ jobs:
commit_email: github@vorondesign.com
secrets:
VORON_BOT_GITHUB_PAT: ${{ secrets.VORON_BOT_GITHUB_PAT }}