-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.42 KB
/
unit_tests.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
name: Formatting and Unit Tests
on:
push:
env:
TERRAFORM_DOCS_VERSION: v0.19.0
jobs:
unit_tests:
name: Unit Test
runs-on: ubuntu-latest
permissions:
checks: write # Required for Publish Test Results
pull-requests: write # Required for Publish Test Results
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version-file: '.python-version'
cache: 'pip' # caching pip dependencies
- run: pip install -r requirements-dev.txt
- name: Install terraform-docs
uses: jaxxstorm/action-install-gh-release@7f2440a9a41f74262d8f6433da138c799799a969 # v1.13.0
with:
repo: terraform-docs/terraform-docs
tag: ${{ env.TERRAFORM_DOCS_VERSION }}
- name: Linting and formatting
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
extra_args: --all-files --show-diff-on-failure
- name: Unit tests
run: |
pytest --cov=manual_scans --cov=utils --cov-branch --cov-fail-under=15 unittests
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2
if: always()
with:
files: "test_reports/*.xml"