Skip to content

Commit

Permalink
devel(CI): RHICOMPL-2542 set up github actions in master
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Jan 31, 2022
1 parent 8936aff commit f2eef65
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
push:
branches:
- master

jobs:
static-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Rubocop
run: bundle exec rubocop --parallel
- name: Brakeman
run: bundle exec brakeman
unit-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
env:
POSTGRES_USER: insights
POSTGRES_DB: insights
POSTGRES_PASSWORD: insights
ports: ["5432:5432"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup database
env:
RAILS_ENV: test
DATABASE_SERVICE_NAME: postgres
POSTGRES_SERVICE_HOST: localhost
POSTGRESQL_USER: insights
POSTGRESQL_PASSWORD: insights
POSTGRESQL_TEST_DATABASE: insights
run: |
bin/rails db:setup;
RAILS_ENV=test bundle exec rails db -p < db/cyndi_setup_test.sql;
- name: Run rswag specs
env:
HOSTNAME: rails
RAILS_ENV: test
DATABASE_SERVICE_NAME: postgres
POSTGRES_SERVICE_HOST: localhost
POSTGRESQL_USER: insights
POSTGRESQL_PASSWORD: insights
POSTGRESQL_TEST_DATABASE: insights
run: bin/rake spec
- name: Run unit tests
env:
HOSTNAME: rails
RAILS_ENV: test
DATABASE_SERVICE_NAME: postgres
POSTGRES_SERVICE_HOST: localhost
POSTGRESQL_USER: insights
POSTGRESQL_PASSWORD: insights
POSTGRESQL_TEST_DATABASE: insights
run: bin/rake test
- name: Upload code coverage
uses: codecov/codecov-action@v2
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.3
3.0.2
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![codecov](https://codecov.io/gh/RedHatInsights/compliance-backend/branch/master/graph/badge.svg)](https://codecov.io/gh/RedHatInsights/compliance-backend)
[![CI](https://github.com/RedHatInsights/compliance-backend/actions/workflows/ci.yml/badge.svg)](https://github.com/RedHatInsights/compliance-backend/actions/workflows/ci.yml)


# Cloud Services for RHEL: Compliance Backend
Expand Down

0 comments on commit f2eef65

Please sign in to comment.