Files
splunk-security_content/.github/workflows/unit-testing.yml
T
Workflow config file is invalid. Please check your config file: model.ReadWorkflow: yaml: line 39: mapping values are not allowed in this context
Bhavin Patel 6085bceb1d updating setup
2024-07-02 12:07:38 -07:00

70 lines
2.8 KiB
YAML

name: detection-testing
on:
push:
pull_request:
types: [opened, reopened]
schedule:
- cron: "44 4 * * *"
jobs:
# validate-tag-if-present:
# runs-on: ubuntu-latest
# steps:
# - name: TAGGED, Validate that the tag is in the correct format
# run: |
# echo "The GITHUB_REF: $GITHUB_REF"
# #First check to see if the release is a tag
# if [[ $GITHUB_REF =~ refs/tags/* ]]; then
# #Yes, this is a tag, so we need to test to make sure that the tag
# #is in the correct format (like v1.10.20)
# if [[ $GITHUB_REF =~ refs/tags/v[0-9]+.[0-9]+.[0-9]+ ]]; then
# echo "PASS: Tagged release with good format"
# exit 0
# else
# echo "FAIL: Tagged release with bad format"
# exit 1
# fi
# else
# echo "PASS: Not a tagged release"
# exit 0
# fi
docker-unit-testing-setup:
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@v3
- 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
run: |
sudo apt update -qq
sudo apt install jq -qq
- name: Install Python Dependencies
run: |
python3.11 -m venv .venv
source .venv/bin/activate
pip install contentctl
git clone --depth=1 --single-branch --branch=master https://github.com/redcanaryco/atomic-red-team.git
- name: print variable names
run: |
source .venv/bin/activate
echo "github.event.issue.pull_request : [${{ github.event.issue.pull_request }}]"
echo "github.event.pull_request.number : [${{ github.event.pull_request.number }}]"
echo "steps.vars.outputs.branch : [${{ steps.vars.outputs.branch }}]"
echo "github.event.pull_request.head.ref : [${{ github.event.pull_request.head.ref }}]"
echo "github.event_name : [${{ github.event_name }}]"
- name: Run ContentCTL test for changes against develop
run: |
source .venv/bin/activate
contentctl test --post-test-behavior never_pause mode:changes --mode.target-branch develop