Skip to content

Added feature to show nodes label #29

Added feature to show nodes label

Added feature to show nodes label #29

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '.github/workflows/manual-release.yml'
jobs:
bundle-app:
name: Bundle App
runs-on: ubuntu-latest
outputs:
app_name: ${{ steps.appinfo.outputs.app_name }}
app_id: ${{ steps.appinfo.outputs.app_id }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Fetch and set app info
id: appinfo
run: |
APP_ID=$(cat app.manifest | jq -r '.info.id.name')
echo "app_id=${APP_ID}" >> $GITHUB_OUTPUT
APP_NAME=$(echo "$APP_ID" | tr _ - )
echo "app_name=${APP_NAME}" >> $GITHUB_OUTPUT
- name: Excluding images from README
run: |
sed -i '/^!/d' README.md
- name: Bundle app source
run: |
mkdir dist
tar -zcvf dist/${{ steps.appinfo.outputs.app_name }}.tgz --exclude='.[^/]*' --exclude=./dist .
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: app_tgz
path: dist/${{ steps.appinfo.outputs.app_name }}.tgz
slim-validate:
name: SLIM Validation
needs: bundle-app
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: app_tgz
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install splunk-packaging-toolkit
- name: Unpackage artifact
run: |
mkdir ${{ needs.bundle-app.outputs.app_id }}
tar -xf ${{ needs.bundle-app.outputs.app_name }}.tgz -C ${{ needs.bundle-app.outputs.app_id }}
- name: Slim Validate
run: slim validate ${{ needs.bundle-app.outputs.app_id }}
appinspect-cli:
name: AppInspect CLI Validation
needs: bundle-app
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: app_tgz
- name: Unpackage artifact
run: |
mkdir -p build/${{ needs.bundle-app.outputs.app_id }}
tar -xf ${{ needs.bundle-app.outputs.app_name }}.tgz -C build/${{ needs.bundle-app.outputs.app_id }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install splunk-appinspect
- name: Run AppInspect
run: |
splunk-appinspect inspect ${{ needs.bundle-app.outputs.app_id }} --output-file appinspect.json
exit `cat appinspect.json | jq '.summary.failure'`
working-directory: ./build
# appinspect-api:
# name: AppInspect API Validation
# needs:
# - bundle-app
# - appinspect-cli
# - slim-validate
# runs-on: ubuntu-latest
# # Job not executed if branch is not master
# if: github.ref == 'refs/heads/master'
# steps:
# - name: Download artifact
# uses: actions/download-artifact@v2
# with:
# name: app_tgz
# - name: Run AppInspect
# uses: splunk/appinspect-api-action@v2
# with:
# filePath: ${{ needs.bundle-app.outputs.app_name }}.tgz
# splunkUser: ${{ secrets.SPLUNK_USER }}
# splunkPassword: ${{ secrets.SPLUNK_PASS }}
# includedTags: cloud
# failOnError: true
# failOnWarning: false