test: creation of metric index #151
Workflow file for this run
This file contains hidden or 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
| name: Gold TA CI | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| - "develop" | |
| pull_request: | |
| branches: | |
| - "**" | |
| workflow_dispatch: | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: pre-commit/action@v3.0.1 | |
| build: | |
| needs: | |
| - pre-commit | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: 'npm' | |
| cache-dependency-path: 'ui/package-lock.json' | |
| node-version-file: 'ui/package.json' | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.7" | |
| - run: | | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| - run: pip install -r requirements-dev.txt | |
| - run: ucc-gen build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Splunk_TA_Example-raw-output | |
| path: output/* | |
| # Taken from https://github.com/splunk/addonfactory-ucc-generator-action/blob/main/action.yml. | |
| # Should resolve `check_for_expansive_permissions` check from AppInspect CLI. | |
| - run: chmod -R +r output | |
| shell: bash | |
| - run: chmod -R go-w output | |
| shell: bash | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: output | |
| path: output/ | |
| - run: ucc-gen package --path output/Splunk_TA_Example | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Splunk_TA_Example | |
| path: Splunk_TA_Example*.tar.gz | |
| ui-checks: | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: ui | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: 'npm' | |
| cache-dependency-path: 'ui/package-lock.json' | |
| node-version-file: 'ui/package.json' | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Code lint | |
| run: npm run lint | |
| - name: Unit tests | |
| run: npm run test | |
| splunk-appinspect-cli: | |
| name: splunk-appinspect-cli ${{ matrix.tags }} | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| strategy: | |
| matrix: | |
| tags: | |
| - "cloud" | |
| - "appapproval" | |
| - "deprecated_feature" | |
| - "developer_guidance" | |
| - "future" | |
| - "self-service" | |
| - "splunk_appinspect" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Splunk_TA_Example | |
| path: build/package | |
| - uses: splunk/appinspect-cli-action@v2.8 | |
| with: | |
| app_path: build/package | |
| included_tags: ${{ matrix.tags }} | |
| psa-test: | |
| runs-on: ubuntu-22.04 | |
| needs: | |
| - build | |
| permissions: | |
| actions: read | |
| deployments: read | |
| contents: read | |
| packages: read | |
| statuses: read | |
| checks: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.7" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Splunk_TA_Example-raw-output | |
| path: psa-output/ | |
| - run: | | |
| ./scripts/run_splunk.sh | |
| until curl -Lsk "https://localhost:8088/services/collector/health" &>/dev/null ; do echo -n "Waiting for HEC-" && sleep 5 ; done | |
| timeout-minutes: 5 | |
| - name: Set up virtual environment | |
| run: | | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| - run: pip install --no-cache-dir -r requirements-dev.txt | |
| - name: Run PSA knowledge tests | |
| run : | | |
| sudo chown -R runner:runner psa-output/Splunk_TA_Example/ | |
| chmod u+rwx psa-output/Splunk_TA_Example/ | |
| pytest tests/knowledge --splunk-type=external --splunk-app=package/ --splunk-data-generator=tests/knowledge --splunk-host=localhost --splunk-port=8089 --splunk-user=admin --splunk-password=Chang3d! --splunk-hec-token=4a8a737d-5452-426c-a6f7-106dca4e813f | |
| - name: Set output if steps failed | |
| run: | | |
| echo "failed=${{ env.failed }}" >> $GITHUB_ENV | |
| outputs: | |
| failed: ${{ env.failed }} | |
| modinput-test: | |
| runs-on: ubuntu-22.04 | |
| needs: | |
| - build | |
| permissions: | |
| actions: read | |
| deployments: read | |
| contents: read | |
| packages: read | |
| statuses: read | |
| checks: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.7" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Splunk_TA_Example | |
| - run: ./scripts/run_locally.sh | |
| - name: Set up virtual environment | |
| run: | | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| - run: pip install --no-cache-dir -r requirements-dev.txt | |
| - name: Run modinput functional tests | |
| run : | | |
| export MODINPUT_TEST_SPLUNK_HOST=localhost | |
| export MODINPUT_TEST_SPLUNK_PORT=8089 | |
| export MODINPUT_TEST_SPLUNK_USERNAME=admin | |
| export MODINPUT_TEST_SPLUNK_PASSWORD_BASE64=$(ucc-test-modinput base64encode -s 'Chang3d!') | |
| export MODINPUT_TEST_EXAMPLE_API_KEY_BASE64=$(ucc-test-modinput base64encode -s 'super-secret-api-token') | |
| ucc-test-modinput gen | |
| pytest tests/ucc_modinput_functional | |
| - name: Set output if steps failed | |
| run: | | |
| echo "failed=${{ env.failed }}" >> $GITHUB_ENV | |
| outputs: | |
| failed: ${{ env.failed }} | |