Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
superstes committed Feb 15, 2025
1 parent 8499f47 commit 55db85b
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 6 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/integration_test_result.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---

name: Integration-Tests

on:

Check warning on line 5 in .github/workflows/integration_test_result.yml

View workflow job for this annotation

GitHub Actions / lint

5:1 [truthy] truthy value should be one of [false, no, true, yes]
schedule:
- cron: "58 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 -f 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 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
34 changes: 34 additions & 0 deletions .github/workflows/integration_test_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---

name: Integration-Tests Execution

on: workflow_dispatch

Check warning on line 5 in .github/workflows/integration_test_run.yml

View workflow job for this annotation

GitHub Actions / lint

5:1 [truthy] truthy value should be one of [false, no, true, yes]

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 -f -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"
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- 'requirements_lint.txt'

jobs:
build:
lint:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

Role to deploy Addons for NFTables on Linux servers.

[![Molecule Test Status](https://badges.ansibleguy.net/addons_nftables.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/addons_nftables.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/addons_nftables.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/addons_nftables.ansiblelint.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/ansiblelint.sh.j2)
[![Lint](https://github.com/ansibleguy/addons_nftables/actions/workflows/lint.yml/badge.svg)](https://github.com/ansibleguy/addons_nftables/actions/workflows/lint.yml)
[![Ansible Galaxy](https://badges.ansibleguy.net/galaxy.badge.svg)](https://galaxy.ansible.com/ui/standalone/roles/ansibleguy/addons_nftables)

Molecule Logs: [Short](https://badges.ansibleguy.net/log/molecule_addons_nftables_test_short.log), [Full](https://badges.ansibleguy.net/log/molecule_addons_nftables_test.log)
**Molecule Integration-Tests**:

* Status: [![Molecule Test Status](https://badges.ansibleguy.net/addons_nftables.molecule.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/molecule.sh.j2) |
[![Functional-Tests](https://github.com/ansibleguy/addons_nftables/actions/workflows/integration_test_result.yml/badge.svg)](https://github.com/ansibleguy/addons_nftables/actions/workflows/integration_test_result.yml)
* Logs: [API](https://ci.ansibleguy.net/api/job/ansible-test-molecule-addons_nftables/logs?token=2b7bba30-9a37-4b57-be8a-99e23016ce70&lines=1000) | [Short](https://badges.ansibleguy.net/log/molecule_addons_nftables_test_short.log) | [Full](https://badges.ansibleguy.net/log/molecule_addons_nftables_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
Expand Down

0 comments on commit 55db85b

Please sign in to comment.