From a441349f64d48b1f6522a45c7886063d18597862 Mon Sep 17 00:00:00 2001 From: Rath Pascal Date: Sat, 8 Feb 2025 12:03:19 +0100 Subject: [PATCH 1/2] add scheduled job to pull integration-test result --- .github/workflows/integration_test_logs.yml | 19 +++++------ .github/workflows/integration_test_result.yml | 33 +++++++++++++++++++ 2 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/integration_test_result.yml diff --git a/.github/workflows/integration_test_logs.yml b/.github/workflows/integration_test_logs.yml index 4c5592c..64c3dc7 100644 --- a/.github/workflows/integration_test_logs.yml +++ b/.github/workflows/integration_test_logs.yml @@ -1,10 +1,10 @@ --- -name: Integration-Test Logs +name: Integration-Test Result on: schedule: - - cron: "24 6 * * *" + - cron: "25 6 * * *" workflow_dispatch: jobs: @@ -22,12 +22,11 @@ jobs: run: sudo apt install curl jq 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 + - name: Checking job-state + run: > + RESULT="$(curl https://ci.ansibleguy.net/api/job/ansible-test-collection-opnsense/state?token=${{ secrets.CI_TOKEN_RO }} | jq -r '.state')" + if [[ "$RESULT" == "failed" ]] + then + exit 1 + fi shell: bash - - - uses: actions/upload-artifact@v4 - with: - name: integration-test-logs - path: /tmp/test.log - retention-days: 14 diff --git a/.github/workflows/integration_test_result.yml b/.github/workflows/integration_test_result.yml new file mode 100644 index 0000000..4c5592c --- /dev/null +++ b/.github/workflows/integration_test_result.yml @@ -0,0 +1,33 @@ +--- + +name: Integration-Test Logs + +on: + schedule: + - cron: "24 6 * * *" + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 1 + + 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 https://ci.ansibleguy.net/api/job/ansible-test-collection-opnsense/logs?token=${{ secrets.CI_TOKEN_RO }} | jq > /tmp/test.log + shell: bash + + - uses: actions/upload-artifact@v4 + with: + name: integration-test-logs + path: /tmp/test.log + retention-days: 14 From 9597aebf90940e4db6a8e96db649811fce49c88f Mon Sep 17 00:00:00 2001 From: Rath Pascal Date: Sat, 8 Feb 2025 12:04:32 +0100 Subject: [PATCH 2/2] add scheduled job to pull integration-test result --- .github/workflows/integration_test_logs.yml | 19 ++++++++++--------- .github/workflows/integration_test_result.yml | 19 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/integration_test_logs.yml b/.github/workflows/integration_test_logs.yml index 64c3dc7..4c5592c 100644 --- a/.github/workflows/integration_test_logs.yml +++ b/.github/workflows/integration_test_logs.yml @@ -1,10 +1,10 @@ --- -name: Integration-Test Result +name: Integration-Test Logs on: schedule: - - cron: "25 6 * * *" + - cron: "24 6 * * *" workflow_dispatch: jobs: @@ -22,11 +22,12 @@ jobs: run: sudo apt install curl jq shell: bash - - name: Checking job-state - run: > - RESULT="$(curl https://ci.ansibleguy.net/api/job/ansible-test-collection-opnsense/state?token=${{ secrets.CI_TOKEN_RO }} | jq -r '.state')" - if [[ "$RESULT" == "failed" ]] - then - exit 1 - fi + - 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 shell: bash + + - uses: actions/upload-artifact@v4 + with: + name: integration-test-logs + path: /tmp/test.log + retention-days: 14 diff --git a/.github/workflows/integration_test_result.yml b/.github/workflows/integration_test_result.yml index 4c5592c..64c3dc7 100644 --- a/.github/workflows/integration_test_result.yml +++ b/.github/workflows/integration_test_result.yml @@ -1,10 +1,10 @@ --- -name: Integration-Test Logs +name: Integration-Test Result on: schedule: - - cron: "24 6 * * *" + - cron: "25 6 * * *" workflow_dispatch: jobs: @@ -22,12 +22,11 @@ jobs: run: sudo apt install curl jq 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 + - name: Checking job-state + run: > + RESULT="$(curl https://ci.ansibleguy.net/api/job/ansible-test-collection-opnsense/state?token=${{ secrets.CI_TOKEN_RO }} | jq -r '.state')" + if [[ "$RESULT" == "failed" ]] + then + exit 1 + fi shell: bash - - - uses: actions/upload-artifact@v4 - with: - name: integration-test-logs - path: /tmp/test.log - retention-days: 14