Skip to content

Commit c08805d

Browse files
Merge pull request #52 from christianncode/feat/AddReusableAndCompositeWorkflows
Feat/add reusable and composite workflows
2 parents df856ed + 5ac125c commit c08805d

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Greeting Workflow
2+
description: A reusable workflow that greets a user by name.
3+
4+
inputs:
5+
name:
6+
description: "Nombre de la persona a saludar"
7+
required: true
8+
default: "Usuario"
9+
message:
10+
description: "Mensaje personalizado"
11+
required: false
12+
default: "Hello"
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Greet User
18+
run: echo "${{ inputs.message }}, ${{ inputs.name }}!"
19+
shell: bash
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI Workflow
2+
description: A reusable workflow for continuous integration tasks.
3+
on: workflow_call
4+
jobs:
5+
CI:
6+
name: Setup Node.js Environment
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
12+
- name: Set up Node.js
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: "22.x"
16+
cache: "pnpm"
17+
18+
- name: Install pnpm
19+
run: npm install -g pnpm
20+
21+
- name: Install dependencies
22+
run: pnpm install
23+
24+
- name: Run tests
25+
run: pnpm test
26+
27+
- name: Build project
28+
run: pnpm run build

.github/workflows/workflow-ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Workflow CI
2+
description: A workflow that calls reusable and composite workflows.
3+
permissions:
4+
contents: read
5+
on: [push]
6+
jobs:
7+
call-reusable-workflow:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Call CI Workflow
11+
uses: ./.github/workflows/utilities/reusable-workflow.yml@main
12+
call-composite-workflow:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Call Greeting Workflow
16+
uses: ./.github/workflows/utilities/composite-workflow.yml
17+
with:
18+
name: "Desarrollador"
19+
message: "Hola"

0 commit comments

Comments
 (0)