Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @splunk/app-development
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
groups:
npm-minor-patch:
update-types: ["minor", "patch"]
cooldown:
default-days: 7
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions:
update-types: ["major", "minor", "patch"]
cooldown:
default-days: 7
43 changes: 29 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
name: Create Release
name: Create release

on:
release:
types: [published]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.release.tag_name }}
cancel-in-progress: false

jobs:
test:
name: Test
uses: $/.github/workflows/test.yml

publish-npm:
name: Publish to npm
needs: test
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 14
node-version: latest
package-manager-cache: false
registry-url: https://registry.npmjs.org/
- run: npm publish
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Package JSON Info
uses: myrotvorets/info-from-package-json-action@1.1.0
- name: Get package version
id: pkgjson

run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
- name: Generate docs
run: node sdkdo docs

- name: Upload Artifact
uses: actions/upload-artifact@v4
run: make docs
- name: Upload docs artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: js_sdk_docs
path: docs-${{ steps.pkgjson.outputs.packageVersion }}/
path: docs-${{ steps.pkgjson.outputs.version }}/
80 changes: 38 additions & 42 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,56 @@
name: Node.js CI
name: JS SDK CI

on: [push, pull_request]
on:
push:
branches: [master, develop]
pull_request:
workflow_dispatch:
workflow_call:

jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
name: Tests (splunk-${{ matrix.splunk-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
node:
- 14
- 8.17.0
splunk-version:
- "8.2"
- "latest"

services:
splunk:
image: splunk/splunk:${{matrix.splunk-version}}
env:
SPLUNK_START_ARGS: --accept-license
SPLUNK_HEC_TOKEN: 11111111-1111-1111-1111-1111111111113
SPLUNK_PASSWORD: changed!
SPLUNK_APPS_URL: https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
ports:
- 8000:8000
- 8088:8088
- 8089:8089

splunk-version: [8.2, 9.4]
steps:
- uses: actions/checkout@v2

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
node-version: ${{ matrix.node }}

persist-credentials: false
- name: Setup node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: latest
cache: npm
- name: Create .splunkrc file
env:
SPLUNK_VERSION: ${{ matrix.splunk-version }}
run: |
cd ~
echo host=localhost > .splunkrc
echo port=8089 >> .splunkrc
echo username=admin >> .splunkrc
echo password=changed! >> .splunkrc
echo scheme=https >> .splunkrc
echo version=${{ matrix.splunk }} >> .splunkrc

- name: Run npm install
run: npm install

- name: Run make test
echo "version=${SPLUNK_VERSION}" >> .splunkrc
- name: Install dependencies
run: npm ci
- name: Launch Splunk Docker instance
env:
SPLUNK_VERSION: ${{ matrix.splunk-version }}
run: make up
- name: Wait for Splunk
run: make wait_up
- name: Run tests
run: make test
env:
SPLUNK_HOME: /opt/splunk
fossa-scan:
uses: splunk/oss-scanning-public/.github/workflows/oss-scan.yml@main
secrets: inherit
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
build/
client/
.git
tests/html/*
*.out
*DS_Store
*.sublime-*
*.pyc
.idea/*
npm-debug.log
server.py
*.log
.buildcache
v8.log
cover_html
.coverage_data
.coverage_debug
*.swp
.splunkrc
.env
*.zip
test_logs/*
docs/
.nyc_output/*
/node_modules/*
.nyc_output/
node_modules/
.vscode/
.code-workspace
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"cSpell.words": [
"elementtree",
"healthcheck",
"mccutchen",
"mochawesome",
"newcap",
"pkgjson",
"sdkdo",
"splunkjs"
]
}
Loading
Loading