-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add workflow to test package building
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: 'Call workflow and wait result' | ||
|
||
inputs: | ||
ref: | ||
description: 'Branch name' | ||
required: true | ||
repository: | ||
description: 'Repository name' | ||
required: true | ||
workflow: | ||
description: 'Workflow to trigger' | ||
required: true | ||
token: | ||
description: 'Wazuh token' | ||
required: true | ||
|
||
outputs: | ||
dispatched_workflow_id: | ||
value: ${{ steps.wait-workflow-compleption.outputs.dispatched_workflow_id }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Dispatch an action and get the run ID | ||
env: | ||
TOKEN: ${{ inputs.token }} | ||
uses: Codex-/[email protected] | ||
id: return_dispatch | ||
with: | ||
token: ${{ env.TOKEN }} | ||
ref: ${{ inputs.ref }} | ||
repo: ${{ inputs.repository }} | ||
owner: wazuh | ||
workflow: ${{ inputs.workflow }} | ||
workflow_timeout_seconds: 900 | ||
workflow_inputs: '{ "architecture": "intel64", "source_reference": "${{ github.ref_name }}" }' | ||
|
||
- name: Wait for the workflow to complete | ||
id: wait-workflow-compleption | ||
run: | | ||
gh run watch ${{steps.return_dispatch.outputs.run_id}} --repo wazuh/${{ inputs.repository }} --exit-status > /dev/null | ||
echo 'Workflow ${{steps.return_dispatch.outputs.run_id}} finished.' | ||
echo "dispatched_workflow_id=$${{steps.return_dispatch.outputs.run_id}}" >> $GITHUB_OUTPUT | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
run-name: Test package | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-binaries-agent-macos-packages: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 50 | ||
name: Test package | ||
|
||
steps: | ||
- name: Checkout the wazuh-agent repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: wazuh/wazuh-agent | ||
ref: enhancement/137-pkg-build-trigger | ||
|
||
- name: Call package build workflow and wait | ||
id: workflow_call | ||
uses: ./.github/actions/call_workflow_and_wait | ||
with: | ||
ref: change/137-setup-pkg-build-workflow-for-macos | ||
repository: wazuh-agent-packages | ||
workflow: packages-build-macos-agent.yml | ||
token: ${{ github.token }} | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
repository: wazuh-agent-packages | ||
name: tested-wazuh-agent-package | ||
github-token: ${{ github.token }} | ||
run-id: ${{ steps.workflow_call.outputs.dispatched_workflow_id }} |