diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 000000000..b5787f34a --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,54 @@ +name: Integration Tests + +on: + push: + pull_request: + branches: + - main + workflow_dispatch: + +## Concurrency only allowed in the main branch. +## So old builds running for old commits within the same Pull Request are cancelled +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +permissions: + contents: read + +jobs: + integration-tests: + name: Integration Test - ES ${{ matrix.elastic-stack-version }} ${{ matrix.snapshot && '(Snapshot)' || '' }} + runs-on: ubuntu-latest + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + elastic-stack-version: + - "7.current" + - "8.previous" + - "8.current" + - "9.current" + snapshot: [false, true] + include: + - elastic-stack-version: "main" + snapshot: true + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup test environment + id: setup + uses: logstash-plugins/.ci/setup@feature/github-actions + with: + elastic-stack-version: ${{ matrix.elastic-stack-version }} + snapshot: ${{ matrix.snapshot }} + integration: true + + - name: Run integration tests + if: steps.setup.outputs.skip != 'true' + run: | + bash .ci/docker-run.sh + + # NOTE: no cleanup needed when running on ephemeral runners diff --git a/.github/workflows/secure-integration-tests.yml b/.github/workflows/secure-integration-tests.yml new file mode 100644 index 000000000..e805161e0 --- /dev/null +++ b/.github/workflows/secure-integration-tests.yml @@ -0,0 +1,53 @@ +name: Secure Integration Tests + +on: + push: + pull_request: + branches: + - main + workflow_dispatch: + +## Concurrency only allowed in the main branch. +## So old builds running for old commits within the same Pull Request are cancelled +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +permissions: + contents: read + +jobs: + secure-integration-tests: + name: Secure Integration Test - ES ${{ matrix.elastic-stack-version }} ${{ matrix.snapshot && '(Snapshot)' || '' }} + runs-on: ubuntu-latest + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + elastic-stack-version: + - "7.current" + - "8.current" + - "9.current" + snapshot: [false, true] + include: + - elastic-stack-version: "main" + snapshot: true + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup test environment + id: setup + uses: logstash-plugins/.ci/setup@feature/github-actions + with: + elastic-stack-version: ${{ matrix.elastic-stack-version }} + snapshot: ${{ matrix.snapshot }} + secure-integration: true + + - name: Run secure integration tests + if: steps.setup.outputs.skip != 'true' + run: | + bash .ci/docker-run.sh + + # NOTE: no cleanup needed when running on ephemeral runners diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..1d9b80667 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,23 @@ +name: Unit Tests + +on: + push: + pull_request: + branches: + - main + workflow_dispatch: + +## Concurrency only allowed in the main branch. +## So old builds running for old commits within the same Pull Request are cancelled +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +permissions: + contents: read + +jobs: + tests: + uses: logstash-plugins/.ci/.github/workflows/test.yml@feature/github-actions + permissions: + contents: read