Debian Codegraph @

ansible_collections/dellemc/openmanage/.github/workflows/ansible-test.yml

raw symbols SCIP
1 name: CI
2
3 concurrency:
4 group: ${{ github.head_ref || github.run_id }}
5 cancel-in-progress: true
6
7 on:
8 # Run CI against all pushes (direct commits, also merged PRs), Pull Requests
9 workflow_dispatch:
10 push:
11 branches:
12 - collections
13 pull_request:
14 # Runs CI on every day (at 06:00 UTC)
15 schedule:
16 - cron: '0 6 * * *'
17
18 jobs:
19 build:
20 name: Build collection
21 runs-on: ubuntu-latest
22 strategy:
23 fail-fast: false
24 matrix:
25 ansible-version: [stable-2.18]
26 steps:
27 - name: Check out code
28 uses: actions/checkout@v3
29
30 - name: Set up Python
31 uses: actions/setup-python@v4
32 with:
33 python-version: 3.12
34
35 - name: Install ansible (${{ matrix.ansible-version }})
36 run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check
37
38 - name: Build a collection tarball
39 run: ansible-galaxy collection build --output-path .cache/collection-tarballs
40
41 - name: Store migrated collection artifacts
42 uses: actions/upload-artifact@v4
43 with:
44 name: collection
45 path: .cache/collection-tarballs
46 ansible-lint:
47 needs: [build]
48 uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main
49 sanity:
50 needs: [build]
51 uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main
52 unit-galaxy:
53 needs: [build]
54 uses: ansible/ansible-content-actions/.github/workflows/unit.yaml@main
55 codecov:
56 name: Codecov
57 runs-on: ubuntu-latest
58 defaults:
59 run:
60 working-directory: ansible_collections/dellemc/openmanage
61 needs: [build]
62 strategy:
63 fail-fast: false
64 matrix:
65 ansible-version: [stable-2.18]
66 steps:
67 - uses: actions/checkout@v4
68 with:
69 path: ansible_collections/dellemc/openmanage
70
71 - name: Set up Python
72 uses: actions/setup-python@v4
73 with:
74 python-version: 3.12
75
76 - name: Install ansible (${{ matrix.ansible-version }})
77 run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check
78
79 - name: Install test dependencies
80 run: pip install -r test-requirements.txt
81
82 - name: Run Pytest with coverage
83 run: export PYTHONPATH="${GITHUB_WORKSPACE}":$PYTHONPATH && pytest -vvvv --cov --cov-branch --cov-report=xml:coverage.xml
84
85 - name: Upload coverage to Codecov
86 uses: codecov/codecov-action@v5
87 with:
88 files: ./coverage.xml,
89 token: ${{ secrets.CODECOV_TOKEN }}
90 fail_ci_if_error: true
91
92 all_green:
93 if: ${{ always() }}
94 needs:
95 - sanity
96 - unit-galaxy
97 - ansible-lint
98 - codecov
99 runs-on: ubuntu-latest
100 steps:
101 - run: >-
102 python -c "assert 'failure' not in
103 set([
104 '${{ needs.sanity.result }}',
105 '${{ needs.unit-galaxy.result }}',
106 '${{ needs.ansible-lint.result }}',
107 '${{ needs.codecov.result }}'
108 ])"