Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/.github/workflows/code-coverage.yml

raw symbols SCIP
1 ---
2 name: Code coverage
3 on:
4 push:
5 pull_request:
6
7 jobs:
8 codecoverage:
9 env:
10 PY_COLORS: "1"
11 source_directory: "./source"
12 ansible-version: latest
13 python-version: "3.10"
14 runs-on: ubuntu-latest
15
16 name: "Code coverage | Python 3.10"
17 steps:
18 - name: Checkout the collection repository
19 uses: actions/checkout@v4
20 with:
21 path: ${{ env.source_directory }}
22 ref: ${{ github.event.pull_request.head.sha }}
23 fetch-depth: "0"
24
25 - name: Set up Python ${{ env.python-version }}
26 uses: actions/setup-python@v5
27 with:
28 python-version: ${{ env.python-version }}
29
30 - name: Install ansible-core (${{ env.ansible-version }})
31 run: python3 -m pip install ansible-core
32
33 - name: Read collection metadata from galaxy.yml
34 id: identify
35 uses: ansible-network/github_actions/.github/actions/identify_collection@main
36 with:
37 source_path: ${{ env.source_directory }}
38
39 - name: Build and install the collection
40 uses: ansible-network/github_actions/.github/actions/build_install_collection@main
41 with:
42 install_python_dependencies: true
43 source_path: ${{ env.source_directory }}
44 collection_path: ${{ steps.identify.outputs.collection_path }}
45 tar_file: ${{ steps.identify.outputs.tar_file }}
46
47 - name: Print the ansible version
48 run: ansible --version
49
50 - name: Print the python dependencies
51 run: python3 -m pip list
52
53 - name: Run code coverage tests
54 run: pytest tests --cov-report term --cov=./
55 working-directory: ${{ steps.identify.outputs.collection_path }}