Skip to content

Commit

Permalink
migrating from travis to github actions (elasticsearch-dump#894)
Browse files Browse the repository at this point in the history
migrating from travis to github actions
  • Loading branch information
ferronrsmith authored Jul 6, 2022
1 parent ae12778 commit 6f30a2b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 37 deletions.
28 changes: 28 additions & 0 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
#
# ES_VERSION=${1}
ES_FLAGS=
echo "running es-version ${ES_VERSION}"
if [ "${ES_VERSION}" == "7.0.0" ]; then
ES_DOWNLOAD_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz"
ES_FLAGS="-Ediscovery.type=single-node"
else
ES_DOWNLOAD_URL="https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz"
fi


echo "url ${ES_DOWNLOAD_URL}"

## ES has different download locations for each version, so we'll download them both and then just use the one we want
curl -Lo elasticsearch.tar.gz "${ES_DOWNLOAD_URL}"

## Now, use the ENV to choose the version
tar -xzf elasticsearch.tar.gz

export ES_JAVA_OPTS="-Xms512m -Xmx512m"
./elasticsearch-${ES_VERSION}/bin/elasticsearch ${ES_FLAGS} &

# ES needs some time to start
wget -q --waitretry=1 --retry-connrefused -T 240 -O - http://127.0.0.1:9200

npm test
34 changes: 34 additions & 0 deletions .github/workflows/elasticdump.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Node CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
es-version:
# - "1.5.0"
# - "2.3.4"
# - "5.6.4"
# - "6.0.0"
- "7.0.0"
node-version:
- 10.x
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '8'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run build script
env:
ES_VERSION: ${{ matrix.es-version }}
run: ./.github/scripts/build.sh
shell: bash
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

0 comments on commit 6f30a2b

Please sign in to comment.