mirror of
https://github.com/splunk/security_content
synced 2026-06-08 17:32:49 +00:00
56 lines
2.2 KiB
YAML
56 lines
2.2 KiB
YAML
name: unit-testing
|
|
on:
|
|
pull_request:
|
|
types: [opened, reopened, synchronize]
|
|
jobs:
|
|
unit-testing:
|
|
runs-on: ubuntu-latest
|
|
if: "!contains(github.ref, 'refs/tags/')" #don't run on tags - future steps won't run either since they depend on this job
|
|
# needs: [validate-tag-if-present, quit-for-dependabot]
|
|
steps:
|
|
- name: Check out the repository code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: develop
|
|
node-version: '20'
|
|
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.11' #Available versions here - https://github.com/actions/python-versions/releases easy to change/make a matrix/use pypy
|
|
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
|
|
|
|
- name: Install System Packages and contentctl
|
|
run: |
|
|
sudo apt update -qq
|
|
sudo apt install jq -qq
|
|
pip install contentctl
|
|
|
|
|
|
- name: Run ContentCTL test for changes against develop
|
|
run: |
|
|
echo "Current Branch (Head Ref): ${{ github.head_ref }}"
|
|
echo "Target Branch (Base Ref): ${{ github.base_ref }}"
|
|
git pull > /dev/null 2>&1
|
|
git checkout ${{ github.head_ref }}
|
|
echo "The target branch for this PR is ${{ github.base_ref }}"
|
|
contentctl test --disable-tqdm --no-enable-integration-testing --post-test-behavior never_pause mode:changes --mode.target-branch ${{ github.base_ref }}
|
|
continue-on-error: true
|
|
|
|
- name: store_artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: test_summary_results
|
|
path: |
|
|
test_results/summary.yml
|
|
dist/DA-ESS-ContentUpdate-latest.tar.gz
|
|
continue-on-error: true
|
|
|
|
- name: Print entire test_results/summary.yml
|
|
run: cat test_results/summary.yml
|
|
continue-on-error: true
|
|
|
|
- name: Formatted Final Report
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pyyaml
|
|
python .github/workflows/format_test_results.py >> $GITHUB_STEP_SUMMARY |