feat: new crate name check, plus reusable workflow (#1935)
* New crate name check, plus reusable workflow * Touch libhello to trigger tests * Give explicit name to reusable workflow
This commit is contained in:
committed by
GitHub
parent
80675a19fc
commit
a5980b01bf
@@ -1,38 +0,0 @@
|
|||||||
name: Check Author
|
|
||||||
|
|
||||||
env:
|
|
||||||
CHECKS_ORG: alire-project
|
|
||||||
CHECKS_REPO: alire-index-checks
|
|
||||||
ALR_VERSION: 2.1.0
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'index/**.toml'
|
|
||||||
|
|
||||||
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`
|
|
||||||
uses: alire-project/setup-alire@v5
|
|
||||||
with:
|
|
||||||
version: ${{env.ALR_VERSION}}
|
|
||||||
|
|
||||||
- name: Test authorship
|
|
||||||
run: ${{env.CHECKS_REPO}}/scripts/check-author.sh "${{ github.event.pull_request.user.login }}"
|
|
||||||
shell: bash
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
name: Check Author
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'index/**.toml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
uses: ./.github/workflows/check-with-script.yml
|
||||||
|
with:
|
||||||
|
name: Author
|
||||||
|
script: check-author.sh
|
||||||
|
script_arg: ${{github.event.pull_request.user.login}}
|
||||||
|
setup_alr: true
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
name: Check Crate Name
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'index/**.toml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
uses: ./.github/workflows/check-with-script.yml
|
||||||
|
with:
|
||||||
|
name: Crate Name
|
||||||
|
script: check-crate-name.sh
|
||||||
|
script_arg: ${{github.event.pull_request.title}}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
name: Check With Script
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
name:
|
||||||
|
description: Display name for the check job
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
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:
|
||||||
|
name: ${{inputs.name}}
|
||||||
|
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
|
||||||
@@ -15,4 +15,4 @@ url = "git+https://github.com/alire-project/libhello.git"
|
|||||||
|
|
||||||
# We use this crate as a trigger to conveniently test minor changes to
|
# We use this crate as a trigger to conveniently test minor changes to
|
||||||
# metaprocesses of the CI of the repository itself.
|
# metaprocesses of the CI of the repository itself.
|
||||||
# Last touch: 2025-12-13 18:31 CET
|
# Last touch: 2026-05-22 17:13 CEST
|
||||||
|
|||||||
Reference in New Issue
Block a user