|
| 1 | +name: Unit Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ['3.x', main] |
| 6 | + pull_request: |
| 7 | + branches: ['3.x', main] |
| 8 | + schedule: |
| 9 | + # Daily run that fans out across every active branch via the matrix |
| 10 | + # job below. GitHub only fires `schedule:` from the workflow file on |
| 11 | + # the default branch (main); copies of this file on |
| 12 | + # non-default branches keep the block for symmetry but it is dormant |
| 13 | + # there. |
| 14 | + - cron: '0 8 * * *' |
| 15 | + workflow_dispatch: |
| 16 | + |
| 17 | +jobs: |
| 18 | + tests: |
| 19 | + if: github.event_name != 'schedule' |
| 20 | + uses: logstash-plugins/.ci/.github/workflows/unit-tests.yml@1.x |
| 21 | + # Forward org/repo secrets (e.g. SLACK_BOT_TOKEN used by the reusable's |
| 22 | + # failure-notification step). The reusable does not declare a |
| 23 | + # workflow_call.secrets block, so `inherit` is required. |
| 24 | + secrets: inherit |
| 25 | + concurrency: |
| 26 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 27 | + cancel-in-progress: ${{ github.ref != 'refs/heads/3.x' && github.ref != 'refs/heads/main' }} |
| 28 | + with: |
| 29 | + # Maintenance-branch narrowing: unit-tests narrowed to match integration-tests |
| 30 | + # because `3.x` is a non-default branch with hand-picked integration versions. |
| 31 | + # Travis on `3.x` has been failing unit-tests against the broader inherited |
| 32 | + # matrix; GHA mirrors only the versions the branch actually supports. |
| 33 | + elastic-stack-versions: '["8.current", "9.current"]' |
| 34 | + timeout-minutes: 60 |
| 35 | + |
| 36 | + scheduled: |
| 37 | + if: github.event_name == 'schedule' |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: |
| 41 | + branch: ['3.x', main] |
| 42 | + uses: logstash-plugins/.ci/.github/workflows/unit-tests.yml@1.x |
| 43 | + secrets: inherit |
| 44 | + with: |
| 45 | + ref: ${{ matrix.branch }} |
| 46 | + elastic-stack-versions: '["8.current", "9.current"]' |
| 47 | + timeout-minutes: 60 |
0 commit comments