Skip to content

Commit

Permalink
Merge pull request #170 from ansibleguy/ci-update
Browse files Browse the repository at this point in the history
update ci
  • Loading branch information
ansibleguy authored Feb 8, 2025
2 parents 1b87c98 + 3614d91 commit edd2e00
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/functional_test_result.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 1
env:
CI_JOB: 'ansible-test-collection-opnsense'
CI_DOMAIN: 'ci.ansibleguy.net'

steps:
- name: Checkout
Expand All @@ -23,16 +26,15 @@ jobs:
shell: bash

- name: Pulling logs
run: curl https://ci.ansibleguy.net/api/job/ansible-test-collection-opnsense/logs?token=${{ secrets.CI_TOKEN_RO }} | jq > /tmp/test.log
run: curl -f https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}/logs?token=${{ secrets.CI_TOKEN_RO }} | jq > /tmp/test.log
shell: bash

- uses: actions/upload-artifact@v4
with:
name: integration-test-logs
name: test-logs
path: /tmp/test.log
retention-days: 14

- name: Checking job-state
run: >
curl https://ci.ansibleguy.net/api/job/ansible-test-collection-opnsense/state?token=${{ secrets.CI_TOKEN_RO }} | jq -r '.state' | grep -q 'failed' && exit 1 || exit 0
run: curl -f https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}/state?token=${{ secrets.CI_TOKEN_RO }} | jq -r '.state' | grep -q 'failed' && exit 1 || exit 0
shell: bash
7 changes: 5 additions & 2 deletions .github/workflows/functional_test_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 1
env:
CI_JOB: 'ansible-test-collection-opnsense'
CI_DOMAIN: 'ci.ansibleguy.net'

steps:
- name: Checkout
Expand All @@ -20,12 +23,12 @@ jobs:
shell: bash

- name: Starting Tests
run: curl -XPOST https://ci.ansibleguy.net/api/job/ansible-test-collection-opnsense?token=${{ secrets.CI_TOKEN_RW }}
run: curl -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://ci.ansibleguy.net/api/job/ansible-test-collection-opnsense/tail?token=${CI_TOKEN_RO}"
echo " > https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}/tail?token=${CI_TOKEN_RO}"
env:
CI_TOKEN_RO: "2b7bba30-9a37-4b57-be8a-99e23016ce70"
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

**Functional Tests**:

* Status: [![Functional Test Status](https://badges.ansibleguy.net/opnsense.collection.test.svg)](https://github.com/ansibleguy/collection_opnsense/blob/latest/scripts/test.sh) | [![Functional-Tests](https://github.com/ansibleguy/collection_opnsense/actions/workflows/functional_test_result.yml/badge.svg)](https://github.com/ansibleguy/collection_opnsense/actions/workflows/functional_test_result.yml)
* Logs: [Full via API](https://ci.ansibleguy.net/api/job/ansible-test-collection-opnsense/logs?token=2b7bba30-9a37-4b57-be8a-99e23016ce70&lines=1000) |
* Status: [![Functional Test Status](https://badges.ansibleguy.net/opnsense.collection.test.svg)](https://github.com/ansibleguy/collection_opnsense/blob/latest/scripts/test.sh) |
[![Functional-Tests](https://github.com/ansibleguy/collection_opnsense/actions/workflows/functional_test_result.yml/badge.svg)](https://github.com/ansibleguy/collection_opnsense/actions/workflows/functional_test_result.yml)
* Logs: [API](https://ci.ansibleguy.net/api/job/ansible-test-collection-opnsense/logs?token=2b7bba30-9a37-4b57-be8a-99e23016ce70&lines=1000) |
[Daily Archive](https://github.com/ansibleguy/collection_opnsense/actions/workflows/functional_test_result.yml) |
[Short](https://badges.ansibleguy.net/log/collection_opnsense_test_short.log) | [Full](https://badges.ansibleguy.net/log/collection_opnsense_test.log)

Expand Down

0 comments on commit edd2e00

Please sign in to comment.