chore(deps): update dependency go to 1.26 #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Enable Log Forwarding Action Tests | |
| on: | |
| pull_request: | |
| workflow_call: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| detect-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| action: ${{ steps.filter.outputs.action }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| action: | |
| - 'actions/enable-log-forwarding/**' | |
| - '.github/workflows/enable_log_forwarding_action_tests.yaml' | |
| test-action: | |
| needs: detect-changes | |
| if: ${{ needs.detect-changes.outputs.action == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Set up uv | |
| uses: astral-sh/[email protected] | |
| - name: Install tox | |
| run: uv tool install tox --with tox-uv | |
| - name: Run lint, static checks, and unit tests | |
| run: tox -e actions-lint,actions-static,actions-unit | |
| smoke-test-self-hosted: | |
| needs: detect-changes | |
| if: ${{ needs.detect-changes.outputs.action == 'true' }} | |
| runs-on: [self-hosted-linux-amd64-noble-edge] | |
| env: | |
| TEST_CONFIG_FILE: 91-enable-log-forwarding-smoke-${{ github.run_id }}-${{ github.run_attempt }}.yaml | |
| TEST_LOG_FILE: /var/log/enable-log-forwarding-smoke-${{ github.run_id }}.log | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Run enable log forwarding action | |
| uses: ./actions/enable-log-forwarding | |
| with: | |
| files: ${{ env.TEST_LOG_FILE }} | |
| config-file-name: ${{ env.TEST_CONFIG_FILE }} | |
| - name: Populate log file to forward | |
| run: | | |
| for i in {1..5}; do | |
| echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) INFO enable-log-forwarding smoke test: entry $i run_id=${{ github.run_id }}" | sudo tee -a ${TEST_LOG_FILE} | |
| sleep 2 | |
| done | |
| - name: Verify generated config file exists | |
| run: | | |
| sudo test -f /etc/otelcol/config.d/${TEST_CONFIG_FILE} | |
| - name: Verify generated config contains expected receiver | |
| run: | | |
| sudo grep -q '"filelog/github_runner_optin"' /etc/otelcol/config.d/${TEST_CONFIG_FILE} | |
| smoke-test-github-hosted: | |
| needs: detect-changes | |
| if: ${{ needs.detect-changes.outputs.action == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Run enable log forwarding action on github-hosted runner | |
| uses: ./actions/enable-log-forwarding | |
| with: | |
| files: | | |
| /var/log/syslog | |
| - name: Verify workflow continues after github-hosted no-op | |
| run: | | |
| echo "enable-log-forwarding exited successfully on github-hosted runner" |