From d6c216840e1c3f398700aaeeca5934f52591deed Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 12 Apr 2021 14:30:01 +1000 Subject: [PATCH] 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. --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 34434d92a7..c88dc71f8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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