-
Notifications
You must be signed in to change notification settings - Fork 383
59 lines (51 loc) · 2.2 KB
/
unit-testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: unit-testing
on:
push:
pull_request:
types: [opened, synchronize, 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@v3
with:
ref: develop
- 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: |
pip install contentctl
git clone --depth=1 --single-branch --branch=master https://github.com/redcanaryco/atomic-red-team.git
- name: Run ContentCTL test for changes against develop
run: |
git pull
git checkout ${GITHUB_REF#refs/heads/}
echo "The target branch for this PR is ${{ github.base_ref }}"
contentctl test --disable-tqdm --post-test-behavior never_pause mode:changes --mode.target-branch ${{ github.base_ref }}
mkdir test_results
# cp summary.yml test_results/
cp test_results/summary.yml artifacts/
continue-on-error: true
- name: store_artifacts
uses: actions/upload-artifact@v3
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
- name: Formatted Final Report
run: |
chmod +x .github/workflows/format_test_summary.sh
./.github/workflows/format_test_summary.sh >> $GITHUB_STEP_SUMMARY