Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Jenkinsfile to GH Actions Workflow #28

Merged
84 changes: 0 additions & 84 deletions .ci/Jenkinsfile

This file was deleted.

7 changes: 0 additions & 7 deletions .ci/install-rbenv.sh

This file was deleted.

42 changes: 0 additions & 42 deletions .ci/jobs/ecs-logging-ruby-mbp.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/test-reporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
## Workflow to process the JUnit test results and add a report to the checks.
name: Test Report
on:
workflow_run:
workflows:
- test
types:
- completed

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: elastic/apm-pipeline-library/.github/actions/test-report@current
with:
artifact: test-results
name: Test Report
path: "spec/junit-reports/**/*-junit.xml"
reporter: java-junit
57 changes: 57 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
## Test with multiple ruby images and frameworks
name: test

on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:
branches:
- main

permissions:
contents: read

jobs:
test:
strategy:
fail-fast: false
matrix:
ruby-image:
- 'ruby:3.2'
- 'ruby:3.1'
- 'ruby:2.7'
reakaleek marked this conversation as resolved.
Show resolved Hide resolved
- 'ruby:2.6'
- 'ruby:2.5'
- 'ruby:2.4'
- 'jruby:9.2'
framework:
- 'rails-6.1'
- 'rails-6.0'
- 'rails-5.2'
- 'sinatra-2.0'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.2'
- uses: elastic/apm-pipeline-library/.github/actions/docker-layer-caching@current
with:
# {hash} must be included according to docs. https:/marketplace/actions/docker-layer-caching
# The key must be unique to every distinct matrix job
key: v2-docker-cache-${{ matrix.ruby-image }}-${{ matrix.framework }}-${{ github.workflow }}-{hash}
restore-keys: |
v2-docker-cache-${{ matrix.ruby-image }}-${{ matrix.framework }}-${{ github.workflow }}-
- name: Test ${{ matrix.ruby-image }}, ${{ matrix.framework }}
env:
RUBY_VERSION: ${{ matrix.ruby-image }}
run: bin/dev --image=${{ matrix.ruby-image }} --frameworks=${{ matrix.framework }}
- uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results
path: 'spec/junit-reports/**/*-junit.xml'
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ RUN chown -R $USER_ID_GROUP /vendor
USER $USER_ID_GROUP

# Upgrade RubyGems and install required Bundler version
RUN gem update --system && \
gem install bundler:$BUNDLER_VERSION
# https:/rubygems/rubygems/issues/2534#issuecomment-448843746
RUN gem update --system --conservative || (gem i "rubygems-update:~>2.7" --no-document && update_rubygems) && \
reakaleek marked this conversation as resolved.
Show resolved Hide resolved
gem install bundler:$BUNDLER_VERSION --conservative

# Use unpatched, system version for more speed over less security
RUN gem install nokogiri -v 1.10.10 -- --use-system-libraries
Expand Down