thomis/db_meta

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: ci

on:
  push:
    branches:
      - "*"

  pull_request:
    branches:
      - "*"

  schedule:
  - cron: 0 2 * * 3,6

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
      ORACLE_HOME: /opt/instantclient_21_12
      LD_LIBRARY_PATH: /opt/instantclient_21_12
      OCI_DIR: /opt/instantclient_21_12
      NLS_LANG: AMERICAN_AMERICA.AL32UTF8

    strategy:
      fail-fast: false
      matrix:
        ruby: [ '3.3', '3.2', '3.1', '3.0']

    name: Ruby ${{ matrix.ruby }}
    steps:
    - uses: actions/checkout@v4

    - name: Install Oracle instant client
      run: |
        mkdir -p /opt && cd /opt
        curl https://download.oracle.com/otn_software/linux/instantclient/2112000/instantclient-basic-linux.x64-21.12.0.0.0dbru.zip --output instantclient.zip
        curl https://download.oracle.com/otn_software/linux/instantclient/2112000/instantclient-sdk-linux.x64-21.12.0.0.0dbru.zip --output instantclient_sdk.zip
        unzip instantclient.zip
        unzip instantclient_sdk.zip

    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler: latest
        bundler-cache: true
        cache-version: 3

    - name: Code Climate setup test reporter
      run: |
        curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
        chmod +x ./cc-test-reporter
        ./cc-test-reporter before-build

    - name: Run default task
      run: |
        bundle exec rake

    - name: Code Climate publish test coverage
      run: |
        ./cc-test-reporter after-build