Skip to content

Commit f782f08

Browse files
authored
Migrate CI from Travis to GitHub Actions (3.x branch)
1 parent e052677 commit f782f08

8 files changed

Lines changed: 142 additions & 17 deletions

File tree

.ci/docker-compose.override.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
- INTEGRATION=${INTEGRATION:-false}
1010
- SECURE_INTEGRATION=${SECURE_INTEGRATION:-false}
1111
- ELASTIC_SECURITY_ENABLED=$ELASTIC_SECURITY_ENABLED
12-
- ELASTIC_PASSWORD=$ELASTIC_PASSWORD
12+
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD:-password}
1313
- ES_SSL_SUPPORTED_PROTOCOLS=$ES_SSL_SUPPORTED_PROTOCOLS
1414

1515
elasticsearch:
@@ -22,7 +22,7 @@ services:
2222
- SECURE_INTEGRATION=${SECURE_INTEGRATION:-false}
2323
- ES_SSL_SUPPORTED_PROTOCOLS=$ES_SSL_SUPPORTED_PROTOCOLS
2424
environment:
25-
- ELASTIC_PASSWORD=$ELASTIC_PASSWORD
25+
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD:-password}
2626
- xpack.security.enabled=${ELASTIC_SECURITY_ENABLED:-false}
2727
- bootstrap.memory_lock=true
2828
- discovery.type=single-node

.ci/docker-run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -ex
66
cd .ci
77

88
if [ "$INTEGRATION" == "true" ]; then
9-
docker-compose up --exit-code-from logstash
9+
docker compose up --exit-code-from logstash
1010
else
11-
docker-compose up --exit-code-from logstash logstash
11+
docker compose up --exit-code-from logstash logstash
1212
fi

.ci/logstash-run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export PATH=$BUILD_DIR/gradle/bin:$PATH
66
# CentOS 7 using curl defaults does not enable TLSv1.3
77
CURL_OPTS="-k --tlsv1.2 --tls-max 1.3"
88

9+
# Default password used by the test harness; Travis injected this via env.
10+
ELASTIC_PASSWORD="${ELASTIC_PASSWORD:-password}"
11+
912
wait_for_es() {
1013
echo "Waiting for elasticsearch to respond..."
1114
es_url="http://elasticsearch:9200"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Integration 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/integration-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+
timeout-minutes: 60
30+
31+
scheduled:
32+
if: github.event_name == 'schedule'
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
branch: ['3.x', main]
37+
uses: logstash-plugins/.ci/.github/workflows/integration-tests.yml@1.x
38+
secrets: inherit
39+
with:
40+
ref: ${{ matrix.branch }}
41+
timeout-minutes: 60
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Secure Integration 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/secure-integration-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+
# Travis only ran secure-integration against 8.current; narrow to match.
30+
elastic-stack-versions: '["8.current"]'
31+
timeout-minutes: 60
32+
33+
scheduled:
34+
if: github.event_name == 'schedule'
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
branch: ['3.x', main]
39+
uses: logstash-plugins/.ci/.github/workflows/secure-integration-tests.yml@1.x
40+
secrets: inherit
41+
with:
42+
ref: ${{ matrix.branch }}
43+
elastic-stack-versions: '["8.current"]'
44+
timeout-minutes: 60

.github/workflows/unit-tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Logstash Plugin
22

3-
[![Travis Build Status](https://travis-ci.com/logstash-plugins/logstash-filter-elasticsearch.svg)](https://travis-ci.com/logstash-plugins/logstash-filter-elasticsearch)
3+
[![Unit Tests](https://github.com/logstash-plugins/logstash-filter-elasticsearch/actions/workflows/unit-tests.yml/badge.svg?branch=3.x)](https://github.com/logstash-plugins/logstash-filter-elasticsearch/actions/workflows/unit-tests.yml)
4+
[![Integration Tests](https://github.com/logstash-plugins/logstash-filter-elasticsearch/actions/workflows/integration-tests.yml/badge.svg?branch=3.x)](https://github.com/logstash-plugins/logstash-filter-elasticsearch/actions/workflows/integration-tests.yml)
5+
[![Secure Integration Tests](https://github.com/logstash-plugins/logstash-filter-elasticsearch/actions/workflows/secure-integration-tests.yml/badge.svg?branch=3.x)](https://github.com/logstash-plugins/logstash-filter-elasticsearch/actions/workflows/secure-integration-tests.yml)
46

57
This is a plugin for [Logstash](https://github.com/elastic/logstash).
68

0 commit comments

Comments
 (0)