Skip to content

Commit 3c16476

Browse files
authored
Migrate CI from Travis to GitHub Actions (main branch)
- Add .github/workflows/unit-tests.yml, integration-tests.yml, and secure-integration-tests.yml calling shared reusable workflows from logstash-plugins/.ci@1.x - Modernize .ci/docker-run.sh: replace docker-compose with docker compose - Modernize .ci/docker-compose.override.yml: use ${ELASTIC_PASSWORD:-password} default to eliminate Travis-injected env var dependency - Modernize .ci/logstash-run.sh: use ${ELASTIC_PASSWORD:-password} default - Update README.md: replace Travis badge with GitHub Actions badges - Delete .travis.yml Closes #222
1 parent 837bce8 commit 3c16476

8 files changed

Lines changed: 131 additions & 18 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ wait_for_es() {
1313
es_url="https://elasticsearch:9200"
1414
fi
1515
count=120
16-
while ! curl $CURL_OPTS -u elastic:$ELASTIC_PASSWORD --silent $es_url && [[ $count -ne 0 ]]; do
16+
while ! curl $CURL_OPTS -u elastic:${ELASTIC_PASSWORD:-password} --silent $es_url && [[ $count -ne 0 ]]; do
1717
count=$(( $count - 1 ))
1818
[[ $count -eq 0 ]] && return 1
1919
sleep 1
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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
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/secure-integration-tests.yml@1.x
38+
secrets: inherit
39+
with:
40+
ref: ${{ matrix.branch }}
41+
timeout-minutes: 60

.github/workflows/unit-tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
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/unit-tests.yml@1.x
38+
secrets: inherit
39+
with:
40+
ref: ${{ matrix.branch }}
41+
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=main)](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=main)](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=main)](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)