diff --git a/.github/workflows/utilities/composite-workflow.yml b/.github/workflows/utilities/composite-workflow.yml new file mode 100644 index 0000000..ee30135 --- /dev/null +++ b/.github/workflows/utilities/composite-workflow.yml @@ -0,0 +1,19 @@ +name: Greeting Workflow +description: A reusable workflow that greets a user by name. + +inputs: + name: + description: "Nombre de la persona a saludar" + required: true + default: "Usuario" + message: + description: "Mensaje personalizado" + required: false + default: "Hello" + +runs: + using: "composite" + steps: + - name: Greet User + run: echo "${{ inputs.message }}, ${{ inputs.name }}!" + shell: bash diff --git a/.github/workflows/utilities/reusable-workflow.yml b/.github/workflows/utilities/reusable-workflow.yml new file mode 100644 index 0000000..e9349a7 --- /dev/null +++ b/.github/workflows/utilities/reusable-workflow.yml @@ -0,0 +1,28 @@ +name: CI Workflow +description: A reusable workflow for continuous integration tasks. +on: workflow_call +jobs: + CI: + name: Setup Node.js Environment + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "22.x" + cache: "pnpm" + + - name: Install pnpm + run: npm install -g pnpm + + - name: Install dependencies + run: pnpm install + + - name: Run tests + run: pnpm test + + - name: Build project + run: pnpm run build diff --git a/.github/workflows/workflow-ci.yml b/.github/workflows/workflow-ci.yml new file mode 100644 index 0000000..144a2b4 --- /dev/null +++ b/.github/workflows/workflow-ci.yml @@ -0,0 +1,19 @@ +name: Workflow CI +description: A workflow that calls reusable and composite workflows. +permissions: + contents: read +on: [push] +jobs: + call-reusable-workflow: + runs-on: ubuntu-latest + steps: + - name: Call CI Workflow + uses: ./.github/workflows/utilities/reusable-workflow.yml@main + call-composite-workflow: + runs-on: ubuntu-latest + steps: + - name: Call Greeting Workflow + uses: ./.github/workflows/utilities/composite-workflow.yml + with: + name: "Desarrollador" + message: "Hola"