Skip to content

Update version #268

Update version

Update version #268

Workflow file for this run

name: build
on:
push:
jobs:
build:
name: Build gem
runs-on: ubuntu-latest
strategy:
matrix:
logstash: [
{ version: '8.5.0', url: "https://artifacts.elastic.co/downloads/logstash/logstash-8.5.0-linux-x86_64.tar.gz" , main: 'true' }
]
env:
LOGSTASH_SOURCE: 1
LOGSTASH_PATH: /home/runner/logstash
JRUBY_HOME: /home/runner/logstash/vendor/jruby
JAVA_HOME: /home/runner/logstash/jdk
steps:
- name: Build logstash
run: |
echo "Getting logstash version ${{matrix.logstash.version}}"
wget -O logstash.tar.gz ${{matrix.logstash.url}}
tar -xf logstash.tar.gz
mv logstash*/ logstash
working-directory: /home/runner
- name: Set Path
run: |
echo "$LOGSTASH_PATH/bin" >> $GITHUB_PATH
echo "$LOGSTASH_PATH/vendor/jruby/bin" >> $GITHUB_PATH
- name: Install bundler
run: jruby -S gem install bundler -v 2.4.19
- name: Checkout code
uses: actions/checkout@v2
with:
path: 'kusto'
- name: List CWD
run: ls -al
working-directory: 'kusto'
- run: jruby -S bundle install
working-directory: 'kusto'
- name: Run gradle vendor
run: ./gradlew vendor
working-directory: 'kusto'
- name: Run unit tests
run: jruby -S bundle exec rspec -r rspec_junit_formatter --format RspecJunitFormatter -o rspec.xml
working-directory: 'kusto'
- run: jruby -S gem build *.gemspec
working-directory: 'kusto'
- run: mv *.gem logstash-kusto.gem
working-directory: 'kusto'
- if: matrix.logstash.main == 'true'
name: Upload gem
uses: actions/upload-artifact@v2
with:
name: logstash-kusto.gem
path: 'kusto/logstash-kusto.gem'
- if: matrix.logstash.main == 'true'
name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: kusto/rspec.xml
e2e:
name: End-To-End Testing
runs-on: ubuntu-latest
needs: build
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: jruby
bundler-cache: true
- name: Checkout code
uses: actions/checkout@v2
- name: Download gem
uses: actions/download-artifact@v2
with:
name: logstash-kusto.gem
- name: Install logstash # taken from logstash's website https://www.elastic.co/guide/en/logstash/7.10/installing-logstash.html#_apt
run: |
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list
sudo apt-get update && sudo apt-get install logstash
- run: sudo chown -R runner /usr/share/logstash
- run: sudo chmod -R u=rx,g=,o= /usr/share/logstash/bin
- name: Install plugin
run: /usr/share/logstash/bin/logstash-plugin install logstash-kusto.gem
- name: Install libraries
run: ./gradlew vendor
- name: Run e2e
run: jruby -J-cp ../vendor/jar-dependencies e2e.rb
working-directory: 'e2e'
env:
ENGINE_URL: ${{ secrets.ENGINE_URL }}
INGEST_URL: ${{ secrets.INGEST_URL }}
APP_ID: ${{ secrets.APP_ID }}
APP_KEY: ${{ secrets.APP_KEY }}
TENANT_ID: ${{ secrets.TENANT_ID }}
TEST_DATABASE: ${{ secrets.TEST_DATABASE }}