Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Create main.yml for CI #2347

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Ruby

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.6.3
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.3
- name: Start services
run: |
docker-compose up -d
- name: Install PostgreSQL Client
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client libpq-dev
- name: Install yarn
run: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.24.6
export PATH=$HOME/.yarn/bin:$PATH
- name: Install dependencies
run: |
gem install bundler
bundle install --jobs 4 --retry 3 --without production
yarn install
- name: Setup the Database
run: |
bundle exec rake db:create db:schema:load db:test:prepare
bundle exec rake factory_bot:lint
- name: Lint code with Rubocop
env:
KNAPSACK_GENERATE_REPORT: true
CLASSROOM_WEBHOOK_URL_PREFIX: https://example.com/github/hooks
GITHUB_CLIENT_ID: client_id
GITHUB_CLIENT_SECRET: client_secret
GOOGLE_CLIENT_ID: google_client_id
GOOGLE_CLIENT_SECRET: google_client_secret
RAILS_ENV: test
RACK_ENV: test
REDIS_URL: "redis://localhost:9736/0"
WEBHOOK_SECRET: abcdefg
API_SECRET: abcdefg
run: ./bin/rake knapsack:rspec && ./bin/rubocop -D
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.4
2.6.3
2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ local: &local
# domain sockets, so uncomment these lines.
host: localhost

port: <%= ENV.fetch("TRAVIS", false) ? 5432 : 2345 %>
port: 2345

production: &production
url: <%= ENV["DATABASE_URL"] %>
Expand Down