.github/workflows/ci.yml
name: CI
on:
workflow_call:
secrets:
MDS_USERNAME:
required: true
MDS_PASSWORD:
required: true
CC_TEST_REPORTER_ID:
required: true
jobs:
test:
runs-on: ubuntu-latest
services:
memcached:
image: memcached:1.4.31
ports:
- 11211/udp
env:
MEMCACHE_SERVERS: "localhost:11211"
MDS_USERNAME: ${{ secrets.MDS_USERNAME }}
MDS_PASSWORD: ${{ secrets.MDS_PASSWORD }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6.9'
- uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install
env:
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: (Lint and) Test
env:
MEMCACHE_SERVERS: "localhost:11211"
run: |
# bundle exec rubocop
bundle exec rspec
echo $?
- name: Publish code coverage
uses: paambaati/codeclimate-action@v3.1.1
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}