Merge pull request #37 from uploadcare/chore/update-base-image #157
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push] | |
| jobs: | |
| linters: | |
| name: Linters | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.4.8 | |
| bundler-cache: true | |
| - name: Run linters | |
| run: bin/rubocop --parallel | |
| - name: Run code metric tools | |
| run: bundle exec rails_best_practices | |
| - name: Run brakeman metric tools | |
| run: bundle exec brakeman | |
| tests: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_USER: postgres | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.4.8 | |
| bundler-cache: true | |
| - name: Install library for postgres | |
| run: sudo apt-get install libpq-dev | |
| - name: Setup Database | |
| run: | | |
| bundle exec rails db:setup | |
| env: | |
| POSTGRES_USERNAME: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_PORT: 5432 | |
| UPLOADCARE_PUBLIC_KEY: demopublickey | |
| UPLOADCARE_SECRET_KEY: demoprivatekey | |
| RAILS_ENV: test | |
| - name: Run tests | |
| run: | | |
| bundle exec rspec | |
| env: | |
| POSTGRES_USERNAME: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_PORT: 5432 | |
| UPLOADCARE_PUBLIC_KEY: demopublickey | |
| UPLOADCARE_SECRET_KEY: demoprivatekey | |
| RAILS_ENV: test | |
| NODE_OPTIONS: "--openssl-legacy-provider" |