add database step #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Knapsack Report | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: postgres:9.4 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
RAILS_ENV: test | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby 3.1 | |
uses: actions/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate new Knapsack report | |
run: | | |
gem install bundler | |
bundle install --jobs 4 --retry 3 | |
- name: Setup Database | |
run: bundle exec rails db:create db:migrate | |
- name: Generate Report | |
run: KNAPSACK=true KNAPSACK_GENERATE_REPORT=true bundle exec rspec | |
- name: Commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add knapsack_rspec_report.json | |
git commit -m "Update knapsack_rspec_report.json" | |
- name: Push changes | |
run: git push origin HEAD:update-knapsack-report | |
- name: Initialize Pull Request | |
uses: gha-utilities/[email protected] | |
with: | |
verbose: true | |
pull_request_token: ${{ secrets.GITHUB_TOKEN }} | |
head: update-knapsack-report | |
base: release/improve-ci | |
title: 'Update Knapsack report' | |
maintainer_can_modify: true | |
debug: true | |
draft: false | |
body: > | |
This is a automated PR |