Skip to content

Update ruby.yml

Update ruby.yml #66

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
# test
name: Cucumber Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
outputs:
reporturl: ${{ steps.reporturl.outputs.url }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install dependencies
run: bundle install
- name: Run tests
run: cucumber ${{ matrix['test-file'] }} --format html > "reports/cucumber-test-report.html"
- name: Run tests with JSON output
run: cucumber --format json > "reports/cucumber-report.json"
- uses: deblockt/[email protected]
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "reports/cucumber-report.json"
- run: ls -ltr reports
- uses: actions/upload-artifact@v4
with:
name: report
path: reports/*-report.*
- id: reporturl
name: Set Report URL
run: echo "url=https://github-actions-logs.s3.amazonaws.com/cucumber-test-report.html" >> $GITHUB_OUTPUT
publish:
runs-on: ubuntu-latest
environment:
name: reports
url: https://github-actions-logs.s3.amazonaws.com/cucumber-test-report.html
needs: test
steps:
- run: echo "${{needs.test.outputs.reportur}}"
- uses: actions/download-artifact@v4
with:
name: report
path: reports/
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
SOURCE_DIR: 'reports' # optional: defaults to entire repository