New crate name check, plus reusable workflow

This commit is contained in:
Alejandro R. Mosteo
2026-05-22 17:09:50 +02:00
parent fd4a04f9e9
commit 17f2b68db5
4 changed files with 80 additions and 38 deletions
+53
View File
@@ -0,0 +1,53 @@
name: Check With Script
on:
workflow_call:
inputs:
script:
description: Script filename under alire-index-checks/scripts/
required: true
type: string
script_arg:
description: Single argument passed to the script
required: true
type: string
setup_alr:
description: Whether to install alr before running the script
required: false
type: boolean
default: false
env:
CHECKS_ORG: alire-project
CHECKS_REPO: alire-index-checks
ALR_VERSION: 2.1.0
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Needed to be able to diff and obtain changed files. Furthermore,
# we need the full history or else grafted partial branches confuse
# the changed files detectors.
- name: Check out alire-index-checks
uses: actions/checkout@v4
with:
repository: ${{env.CHECKS_ORG}}/${{env.CHECKS_REPO}}
ref: ${{github.base_ref}}
path: ${{env.CHECKS_REPO}}
- name: Set up stable `alr`
if: inputs.setup_alr
uses: alire-project/setup-alire@v5
with:
version: ${{env.ALR_VERSION}}
- name: Run check
run: >
${{env.CHECKS_REPO}}/scripts/${{inputs.script}}
"${{inputs.script_arg}}"
shell: bash