Skip to content

Smoke Tests

Smoke Tests #541

Workflow file for this run

name: "Smoke Tests"
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 4 * * *'
permissions:
actions: write # Needed for skip-duplicate-jobs job
contents: read
jobs:
# Special job which automatically cancels old runs for the same branch, prevents runs for the
# same file set which has already passed, etc.
pre_job:
name: Skip Duplicate Jobs Pre Job
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@f11521568414503656a5af807dc3018c012552c4 # v3.4.1
with:
cancel_others: 'true'
github_token: ${{ github.token }}
git_dev_version:
name: Git Dev Version - ${{ matrix.compression }}
runs-on: ubuntu-latest
timeout-minutes: 25
needs: pre_job
# NOTE: We always want to run job on master branch
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/master' }}
strategy:
fail-fast: false
matrix:
compression:
- "deflate"
- "zstandard"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python 3.8
uses: actions/setup-python@v4
id: setup-python
with:
python-version: 3.8
- name: Setup jRuby
uses: ruby/setup-ruby@ece82769428359c077b5a5eaff268902a303c101 # v1.120.0
with:
ruby-version: 'jruby'
bundler-cache: true
- name: Build Gem
run: |
gem build logstash-output-scalyr.gemspec
# We rename the file so we don't need to hard code version in Dockerfile
mv logstash-output-scalyr-*.gem logstash-output-scalyr.gem
- name: Run Smoke Tests
env:
SCALYR_SERVER: ${{ secrets.SCALYR_SERVER }}
SCALYR_API_KEY: ${{ secrets.SCALYR_API_KEY }}
READ_API_KEY: ${{ secrets.READ_API_KEY }}
run: |
gemfile=$(ls *.gem)
echo "Using gemfile: ${gemfile}"
cp $gemfile .circleci/docker/
# NOTE: We need script workaround due to no tty - https://github.com/actions/runner/issues/808
script -e -c ".circleci/smoketest_logstash.sh yarnsh/agent-testing:latest 300 $gemfile .circleci/docker 1"
git_stable_version:
name: Stable / Beta RubyGem Version - ${{ matrix.compression }}
runs-on: ubuntu-latest
timeout-minutes: 25
needs: pre_job
# NOTE: We always want to run job on master branch
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/master' }}
strategy:
fail-fast: false
matrix:
compression:
- "deflate"
- "zstandard"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python 3.8
uses: actions/setup-python@v4
id: setup-python
with:
python-version: 3.8
- name: Setup jRuby
uses: ruby/setup-ruby@ece82769428359c077b5a5eaff268902a303c101 # v1.120.0
with:
ruby-version: 'jruby'
bundler-cache: true
- name: Download Gem From RubyGems
run: |
LATEST_STABLE_VERSION=$(curl https://rubygems.org/api/v1/versions/logstash-output-scalyr/latest.json | jq .version | tr -d '"')
LATEST_BETA_VERSION=$(curl https://rubygems.org/api/v1/versions/logstash-output-scalyr.json | jq .[0].number | tr -d '"')
echo "Using version: ${LATEST_BETA_VERSION}"
wget https://rubygems.org/downloads/logstash-output-scalyr-${LATEST_BETA_VERSION}.gem
# We rename the file so we don't need to hard code version in Dockerfile
mv logstash-output-scalyr-*.gem logstash-output-scalyr.gem
- name: Run Smoke Tests
env:
SCALYR_SERVER: ${{ secrets.SCALYR_SERVER }}
SCALYR_API_KEY: ${{ secrets.SCALYR_API_KEY }}
READ_API_KEY: ${{ secrets.READ_API_KEY }}
run: |
gemfile=$(ls *.gem)
echo "Using gemfile: ${gemfile}"
cp $gemfile .circleci/docker/
# NOTE: We need script workaround due to no tty - https://github.com/actions/runner/issues/808
script -e -c ".circleci/smoketest_logstash.sh yarnsh/agent-testing:latest 300 $gemfile .circleci/docker 1"