Skip to content

Commit

Permalink
Update GitHub actions for consistency
Browse files Browse the repository at this point in the history
- Fix tests
- Make the services, test names, etc consistent with other ManageIQ
  repos
- Fix CodeClimate
  • Loading branch information
Fryguy committed Jan 10, 2022
1 parent d14947d commit ca6985d
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 109 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI

on: [push, pull_request]

jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version:
- '2.7'
activerecord:
- "52"
- "60"
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: virtual_attributes
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 2s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8.0
env:
MYSQL_HOST: 127.0.0.1
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: virtual_attributes
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -P 3306 --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 3
env:
# for the pg cli (psql, pg_isready) and possibly rails
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: password
# for the mysql cli (mysql, mysqladmin)
MYSQL_HOST: 127.0.0.1
MYSQL_PWD: password
# for rails tests (from matrix)
BUNDLE_GEMFILE: gemfiles/gemfile_${{ matrix.activerecord }}.gemfile
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run SQLite tests
env:
DB: sqlite3
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: bundle exec rake
- name: Run Postgres tests
env:
DB: pg
COLLATE_SYMBOLS: false
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: bundle exec rake
- name: Run MySQL tests
env:
DB: mysql2
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: bundle exec rake
- if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '2.7' }}
name: Report code coverage
continue-on-error: true
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
107 changes: 0 additions & 107 deletions .github/workflows/ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# VirtualAttributes

![Build Status](https://github.com/ManageIQ/activerecord-virtual_attributes/actions/workflows/ci.yml/badge.svg)
[![CI](https://github.com/ManageIQ/activerecord-virtual_attributes/actions/workflows/ci.yaml/badge.svg)](https://github.com/ManageIQ/activerecord-virtual_attributes/actions/workflows/ci.yaml)
[![Maintainability](https://api.codeclimate.com/v1/badges/e1a0c26941c00f4edb55/maintainability)](https://codeclimate.com/github/ManageIQ/activerecord-virtual_attributes/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/e1a0c26941c00f4edb55/test_coverage)](https://codeclimate.com/github/ManageIQ/activerecord-virtual_attributes/test_coverage)

Expand Down
2 changes: 1 addition & 1 deletion activerecord-virtual_attributes.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "db-query-matchers", "~>0.10"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "simplecov", ">= 0.21.2"
spec.add_development_dependency "manageiq-style"
end

0 comments on commit ca6985d

Please sign in to comment.