Skip to content

fix test

fix test #309

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 install a prebuilt Ruby version, install dependencies, and
# run tests and linters.
name: "Generate sample app and run tests"
on: [push]
jobs:
test_html:
name: 🧪 Run HTML Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install the latest Rails gem
run: gem install rails -v "7.1.0"
- name: Install Rubocop
run: gem install rubocop rubocop-performance rubocop-minitest rubocop-packaging rubocop-minitest rubocop-rails
- name: Install Brakeman
run: gem install brakeman
- name: Create fresh Rails app and run generator
run: |
rails new test-app
cp .rubocop.yml test-app/.rubocop.yml
cd test-app
bundle add authentication-zero --path ..
bin/rails generate authentication
bundle install
bin/rails db:migrate
- name: Rubocop
run: cd test-app && rubocop
- name: Brakeman
run: cd test-app && brakeman
- name: Tests
run: |
cd test-app
bin/rails test
bin/rails test:system
test_api:
name: 🧪 Run API Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install the latest Rails gem
run: gem install rails -v "7.1.0"
- name: Install Rubocop
run: gem install rubocop rubocop-performance rubocop-minitest rubocop-packaging rubocop-minitest rubocop-rails
- name: Install Brakeman
run: gem install brakeman
- name: Create fresh Rails app and run generator
run: |
rails new test-app
cp .rubocop.yml test-app/.rubocop.yml
cd test-app
bundle add authentication-zero --path ..
bin/rails generate authentication --api
bundle install
bin/rails db:migrate
- name: Rubocop
run: cd test-app && rubocop
- name: Brakeman
run: cd test-app && brakeman
- name: Tests
run: cd test-app && bin/rails test