From cc009f4c1764ede92ae9bb19d1ee75549822d7ed Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Thu, 9 Nov 2023 14:14:56 +0100 Subject: [PATCH] Run postgres for tests Using dentarg/postgres --- .github/workflows/tests.yml | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4143675f..ca51af6d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: with: ruby-version: 3.1 bundler-cache: true - linter: + rubocop: needs: setup runs-on: ubuntu-latest steps: @@ -25,9 +25,9 @@ jobs: with: ruby-version: 3.1 bundler-cache: true - - name: Run linter + - name: Run rubocop run: bundle exec rubocop - haml-linter: + haml-lint: needs: setup runs-on: ubuntu-latest steps: @@ -36,27 +36,21 @@ jobs: with: ruby-version: 3.1 bundler-cache: true - - name: Run linter + - name: Run haml-lint run: bundle exec haml-lint app/views/ - unit: - needs: [linter, haml-linter] + tests: + needs: [rubocop, haml-lint] runs-on: ubuntu-latest steps: + - uses: dentarg/postgres@v1 - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: 3.1 bundler-cache: true - - name: Run unit tests - run: bundle exec rake test - system: - needs: [linter, haml-linter] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.1 - bundler-cache: true - - name: Run system tests - run: bundle exec rake test:system + - name: Run tests + run: | + bundle exec rake db:setup + bundle exec rails test -vp + env: + DATABASE_URL: "${{ env.POSTGRES_URL }}"