diff --git a/.github/workflows/diffs.yaml b/.github/workflows/diffs.yaml deleted file mode 100644 index 4b71f97..0000000 --- a/.github/workflows/diffs.yaml +++ /dev/null @@ -1,61 +0,0 @@ -on: - push: - - workflow_dispatch: - inputs: - - daemon_debug: - description: 'Enable or disable the AP daemon debug' - required: true - type: choice - default: "ON" - options: - - "ON" - - "OFF" - - daemon_port: - description: 'Port for the AP daemon' - required: true - type: string - default: "5000" - - execution_period: - description: 'Execution period for the AP full pipeline' - required: true - type: string - default: "6h" - -name: CI -jobs: - diff: - name: diff - runs-on: ubuntu-latest - - strategy: - matrix: - project: - - dependencies: 'src.*one.*cpp|src.*two.*cpp' - path: src/one - - dependencies: 'src.*two.*cpp' - path: src/two - steps: - - name: echo vars - run: | - - echo "${{ inputs.execution_period }}" - echo "${{ inputs.daemon_port }}" - echo "${{ inputs.daemon_debug }}" - - echo ${{ inputs.execution_period }} - echo ${{ inputs.daemon_port }} - echo ${{ inputs.daemon_debug }} - - # Prepare project repository. - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Check for compilation requirement - id: test - run: | - DIFFS=$(git diff --name-only HEAD origin/${{ github.head_ref }}) - echo $DIFFS diff --git a/.github/workflows/groups.yml b/.github/workflows/groups.yml deleted file mode 100644 index a2a829a..0000000 --- a/.github/workflows/groups.yml +++ /dev/null @@ -1,16 +0,0 @@ -on: - push: - -concurrency: - group: "branch name" - cancel-in-progress: true - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: delay - run: sleep 10 - - - name: print - run: echo "hello world" diff --git a/.github/workflows/inputs.yaml b/.github/workflows/inputs.yaml index 62ba216..600a7fb 100644 --- a/.github/workflows/inputs.yaml +++ b/.github/workflows/inputs.yaml @@ -1,41 +1,41 @@ +name: Checkout testing + on: + push: + workflow_dispatch: inputs: - daemon_debug: - description: 'Enable or disable the AP daemon debug' - required: true - type: choice - default: "ON" - options: - - "ON" - - "OFF" - - daemon_port: - description: 'Port for the AP daemon' - required: true - type: string - default: "5000" - - execution_period: - description: 'Execution period for the AP full pipeline' + wazuh_version: + description: 'Identifier of the generated content. The generated file will be named vd_1.0.0_vd_.tar.xz' required: true type: string - default: "6h" jobs: - log-the-inputs: + checkout_testing: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Idenentifiers of the generated content. The generated files will be named vd_1.0.0_vd_.tar.xz + wazuh_version: ["testing", "testing2", "invalid branch"] + steps: - - name: print - env: - DEBUG: ${{ inputs.daemon_debug }} - PORT: ${{ inputs.daemon_port }} - PERIOD: ${{ inputs.execution_period }} - run: | - echo "Debug: ${DEBUG}" - echo "Port: ${PORT}" - echo "Period: ${PERIOD}" + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + ref: ${{ matrix.wazuh_version }} - echo "Debug: ${{ inputs.daemon_debug }}" - echo "Port: ${{ inputs.daemon_port }}" - echo "Period: ${{ inputs.execution_period }}" + # Checkout to the tag + # If the tag does not exist, checkout to the branch + # If the branch does not exist, exit with an error + - name: Checkout to wazuh_version + run: | + if git show-ref --tags --verify --quiet "refs/tags/v${{ matrix.wazuh_version }}"; then + git checkout --quiet "tags/v${{ matrix.wazuh_version }}" + else + echo "Warning: Unable to find tag v${{ matrix.wazuh_version }}. Continuing with branch ${{ matrix.wazuh_version }}" + fi