build: disable gem cache and fix workflow #1
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: Test | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
# If you need DB like PostgreSQL, Redis then define service below. | |
# https://github.com/actions/example-services/tree/master/.github/workflows | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: --entrypoint redis-server | |
env: | |
RAILS_ENV: test | |
GEMFILE_RUBY_VERSION: 3.0.0 | |
# Rails verifies the time zone in DB is the same as the time zone of the Rails app | |
# TZ: "Europe/Berlin" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: ghostscript pdftk tesseract-ocr tesseract-ocr-deu tnef | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
# Not needed with a .ruby-version file | |
ruby-version: 3.0.6 | |
# runs 'bundle install' and caches installed gems automatically | |
bundler-cache: true | |
- name: Update Dependencies | |
run: | | |
bundle check || bundle install | |
yarn install --immutable --immutable-cache --check-cache | |
bin/rails assets:precompile | |
- name: Create DB | |
run: | | |
bin/rails db:prepare | |
- name: Run tests | |
run: | | |
bin/rails test |