Created
July 5, 2021 21:19
-
-
Save danielabar/b5399ce8929a417645b0f67e136f3508 to your computer and use it in GitHub Desktop.
Debug Github Actions Medium Post Gist 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
# .github/workflows/ci.yml | |
name: CI | |
on: push | |
env: | |
RAILS_ENV: test | |
RACK_ENV: test | |
DATABASE_HOST: "127.0.0.1" | |
REDIS_URL: "redis://127.0.0.1" | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: postgres:13 | |
env: | |
POSTGRES_PASSWORD: its_a_secret | |
POSTGRES_USER: postgres | |
ports: | |
- 5432:5432 | |
volumes: | |
- /home/runner/work/myapp/myapp/init.sql:/docker-entrypoint-initdb.d/init.sql | |
redis: | |
image: redis:6 | |
ports: | |
- 6379:6379 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v1 | |
- name: Setup Ruby 2.7 | |
uses: actions/setup-ruby@v1 | |
with: | |
ruby-version: '2.7' | |
- name: Setup Node | |
uses: actions/setup-node@v2-beta | |
with: | |
node-version: '12' | |
- name: bundle install | |
run: bundle install | |
- name: yarn install | |
run: yarn | |
- name: Initialize database | |
run: bundle exec rake db:reset | |
- name: Run linter | |
run: rubocop | |
- name: Run tests | |
run: bundle exec rspec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment