From ec2968433cd8071bdcf48ee5f6b1760bd36b23f7 Mon Sep 17 00:00:00 2001 From: Nastia Gorokhova-Alekseeva Date: Thu, 13 Jan 2022 23:46:59 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D0=BC=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B3=D0=BE?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2=20=D0=B2=20?= =?UTF-8?q?CI=20=D0=B3=D0=B8=D1=82=D1=85=D0=B0=D0=B1=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yaml | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..db1800e --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,50 @@ +name: Test +on: [push] +jobs: + runTests: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + # EKAM + - ruby-version: 2.5.8 + rails-version: 52 + # InSales + - ruby-version: 2.6.6 + rails-version: 52 + + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails-version }}.gemfile + + services: + postgres: + image: postgres:12-alpine + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: "" + POSTGRES_DB: postgres + POSTGRES_HOST_AUTH_METHOD: trust + ports: + - 5432:5432 + steps: + - uses: actions/checkout@master + - name: Install ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + + - name: Create databases + env: + RAILS_ENV: test + PGHOST: localhost + PGUSER: postgres + PGPORT: 5432 + run: sudo -u postgres createdb -h localhost -p 5432 -U postgres paperclip_test + + - name: Run tests + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + bundle exec appraisal rails_${{ matrix.rails-version }} rake test