Files
splunk-security_content/.github/workflows/unit-testing.yml
2024-07-08 14:02:05 -07:00

50 lines
1.6 KiB
YAML

name: unit-testing
on:
push:
pull_request:
types: [opened, reopened]
jobs:
contentctl-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
- uses: actions/setup-python@v5
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 Python Dependencies
run: |
pip install contentctl
- name: Run ContentCTL test for changes against develop
run: |
git pull
git checkout ${GITHUB_REF#refs/heads/}
contentctl test --disable-tqdm --post-test-behavior never_pause mode:changes --mode.target-branch develop
continue-on-error: true
- name: store_artifacts
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
test_results/summary.yml
- name: Print entire test_results/summary.yml
run: cat test_results/summary.yml
- name: Set Step Summary
run: head -n 9 test_results/summary.yml >> $GITHUB_STEP_SUMMARY