diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 5dbfa6a..ed97d53 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1 @@ --- - -ko_fi: ansible0guy -github: ansibleguy diff --git a/.github/workflows/integration_test_result.yml b/.github/workflows/integration_test_result.yml new file mode 100644 index 0000000..164d9cb --- /dev/null +++ b/.github/workflows/integration_test_result.yml @@ -0,0 +1,41 @@ +--- + +name: Integration-Tests + +on: + # schedule: + # - cron: "54 6 * * *" + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 1 + env: + CI_JOB: 'ansible-test-molecule-${{ github.event.repository.name }}' + CI_DOMAIN: 'ci.ansibleguy.net' + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + + - name: Install dependencies + run: sudo apt install curl jq + shell: bash + + - name: Pulling logs + run: curl --fail-with-body https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}/logs?token=${{ secrets.CI_TOKEN_RW }} | jq > /tmp/test.log + shell: bash + + - uses: actions/upload-artifact@v4 + with: + name: test-logs + path: /tmp/test.log + retention-days: 14 + + - name: Checking job-state + run: > + curl --fail-with-body https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}/state?token=${{ secrets.CI_TOKEN_RW }} | jq -r '.state' | grep -q 'failed' && exit 1 || exit 0 + shell: bash diff --git a/.github/workflows/integration_test_run.yml b/.github/workflows/integration_test_run.yml new file mode 100644 index 0000000..cb8ca4d --- /dev/null +++ b/.github/workflows/integration_test_run.yml @@ -0,0 +1,34 @@ +--- + +name: Integration-Tests Execution + +on: workflow_dispatch + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 1 + env: + CI_JOB: 'ansible-test-molecule-${{ github.event.repository.name }}' + CI_DOMAIN: 'ci.ansibleguy.net' + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + + - name: Install dependencies + run: sudo apt install curl + shell: bash + + - name: Starting Tests + run: curl --fail-with-body -XPOST https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}?token=${{ secrets.CI_TOKEN_RW }} + shell: bash + + - name: You can pull the current logs at this URL + run: > + echo "You can pull the current logs at this URL:" + echo " > https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}/tail?token=${CI_TOKEN_RO}" + env: + CI_TOKEN_RO: "2b7bba30-9a37-4b57-be8a-99e23016ce70" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 20c35d6..ee7e3b7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,6 +10,10 @@ on: - '**.yml' - '.github/workflows/lint.yml' - 'requirements_lint.txt' + - '.yamllint' + - '.pylintrc' + - '.pylintrc_j2' + - '.ansible-lint.yml' pull_request: branches: [main, stable, latest] paths: @@ -17,9 +21,13 @@ on: - '**.yml' - '.github/workflows/lint.yml' - 'requirements_lint.txt' + - '.yamllint' + - '.pylintrc' + - '.pylintrc_j2' + - '.ansible-lint.yml' jobs: - build: + lint: runs-on: ubuntu-latest timeout-minutes: 2 steps: @@ -31,7 +39,7 @@ jobs: - name: Install python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Install dependencies run: | diff --git a/README.md b/README.md index ccc368a..7251440 100644 --- a/README.md +++ b/README.md @@ -10,18 +10,20 @@ You will need to manage the zabbix-agent integration(s) into your systems on you **NOTE:** Check out the [Zabbix Server dockerized](https://github.com/ansibleguy/sw_zabbix_server) Role if you prefer Docker setups. -Buy me a coffee - -[![Molecule Test Status](https://badges.ansibleguy.net/sw_zabbix.molecule.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/molecule.sh.j2) -[![YamlLint Test Status](https://badges.ansibleguy.net/sw_zabbix.yamllint.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/yamllint.sh.j2) -[![PyLint Test Status](https://badges.ansibleguy.net/sw_zabbix.pylint.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/pylint.sh.j2) -[![Ansible-Lint Test Status](https://badges.ansibleguy.net/sw_zabbix.ansiblelint.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/ansiblelint.sh.j2) +[![Lint](https://github.com/ansibleguy/sw_zabbix/actions/workflows/lint.yml/badge.svg)](https://github.com/ansibleguy/sw_zabbix/actions/workflows/lint.yml) [![Ansible Galaxy](https://badges.ansibleguy.net/galaxy.badge.svg)](https://galaxy.ansible.com/ui/standalone/roles/ansibleguy/sw_zabbix) -Molecule Logs: [Short](https://badges.ansibleguy.net/log/molecule_sw_zabbix_test_short.log), [Full](https://badges.ansibleguy.net/log/molecule_sw_zabbix_test.log) +**Molecule Integration-Tests**: + +* Status: [![Molecule Test Status](https://badges.ansibleguy.net/sw_zabbix.molecule.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/molecule.sh.j2) | +[![Functional-Tests](https://github.com/ansibleguy/sw_zabbix/actions/workflows/integration_test_result.yml/badge.svg)](https://github.com/ansibleguy/sw_zabbix/actions/workflows/integration_test_result.yml) +* Logs: [API](https://ci.ansibleguy.net/api/job/ansible-test-molecule-sw_zabbix/logs?token=2b7bba30-9a37-4b57-be8a-99e23016ce70&lines=1000) | [Short](https://badges.ansibleguy.net/log/molecule_sw_zabbix_test_short.log) | [Full](https://badges.ansibleguy.net/log/molecule_sw_zabbix_test.log) + +Internal CI: [Tester Role](https://github.com/ansibleguy/_meta_cicd) | [Jobs API](https://github.com/O-X-L/github-self-hosted-jobs-systemd) **Tested:** * Debian 11 +* Debian 12 ----