Use matrix to split jobs

This demonstrates how you can split the tests across multiple jobs
without repeating the job configuration. This has a lot of potential to
DRY our config.
This commit is contained in:
Maikel Linke
2021-04-12 14:30:01 +10:00
parent 6669a2c108
commit d6c216840e

View File

@@ -28,6 +28,11 @@ jobs:
POSTGRES_DB: open_food_network_test
POSTGRES_USER: ofn
POSTGRES_PASSWORD: f00d
strategy:
matrix:
specs:
- "spec/controllers"
- "spec/serializers"
steps:
- uses: actions/checkout@v2
@@ -52,7 +57,7 @@ jobs:
bundle exec rake db:schema:load RAILS_ENV=test
- name: Run controller tests
run: bundle exec rspec --profile -- spec/controllers spec/serializers
run: bundle exec rspec --profile -- ${{ matrix.specs }}
test-models:
runs-on: ubuntu-18.04