ansible-collection-infomaniak/.gitea/workflows/pull-request-open.yml

68 lines
1.8 KiB
YAML
Raw Normal View History

---
name: pull-requests-open
on:
pull_request:
types:
- opened
- edited
- synchronize
branches:
- main
- develop
jobs:
commit-history-check:
name: Check commit compliance
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Install commitizen
run: pip3 install commitizen
shell: bash
working-directory: ${{ gitea.workspace }}
- name: Verify commit message compliance
run: |
echo "cz check --rev-range origin/${{ gitea.event.pull_request.base.ref }}.."
cz check --rev-range origin/${{ gitea.event.pull_request.base.ref }}..
shell: bash
working-directory: ${{ gitea.workspace }}
run-tests:
name: Run tests
runs-on: ubuntu-latest
2024-09-14 11:15:07 +00:00
needs: commit-history-check
steps:
- name: Checkout
uses: actions/checkout@v4
2024-09-14 19:09:31 +00:00
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.10"
2024-09-14 11:18:01 +00:00
2024-09-14 19:36:28 +00:00
- name: Install requirements
run: pip3 install -r tests/requirements.txt
shell: bash
working-directory: ${{ gitea.workspace }}
- name: Setup testing environment
run: ansible-galaxy collection install ${{ gitea.workspace }}
shell: bash
working-directory: ${{ gitea.workspace }}
- name: Run ansible unit tests
run: ansible-test units --coverage
shell: bash
2024-09-14 19:41:43 +00:00
working-directory: /root/.ansible/collections/ansible_collections/ednz_cloud/infomaniak
2024-09-14 19:36:28 +00:00
- name: Print coverage informations
run: ansible-test coverage report
shell: bash
2024-09-14 19:41:43 +00:00
working-directory: /root/.ansible/collections/ansible_collections/ednz_cloud/infomaniak