Skip to content

docs-builder: add pull-requests: write permission to docs-build wor… #209

docs-builder: add pull-requests: write permission to docs-build wor…

docs-builder: add pull-requests: write permission to docs-build wor… #209

Workflow file for this run

---
## 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'
- '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://github.com/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 }}
- name: prepare artifact name # because it cannot have colons ":"
id: artifact_name
run: |
echo "artifact_name=test-results-${RUBY_IMAGE//:/_}-${FRAMEWORK}" >> "${GITHUB_OUTPUT}"
env:
RUBY_IMAGE: ${{ matrix.ruby-image }}
FRAMEWORK: ${{ matrix.framework }}
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: ${{ steps.artifact_name.outputs.artifact_name }}
path: 'spec/junit-reports/**/*-junit.xml'