diff --git a/.github/workflows/sherlock_test.yml b/.github/workflows/sherlock_test.yml index 24ce8992..5d7bf9fa 100644 --- a/.github/workflows/sherlock_test.yml +++ b/.github/workflows/sherlock_test.yml @@ -7,12 +7,26 @@ on: branches: [ master ] jobs: + getchange: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.changes.outputs.matrix }} + steps: + - id: changes + run: | + URL="https://api.github.com/repos/sherlock-project/sherlock/pulls/${{ github.event.pull_request.number }}/files" + FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename') + if echo $FILES | grep -q ".json"; then + echo "::set-output name=matrix::{\"include\":[{\"python\":\"3.8\"}]}" + else + echo "::set-output name=matrix::{\"include\":[{\"python\":\"3.6\" },{\"python\":\"3.7\"},{\"python\":\"3.8\"}]}" + fi build: - + needs: getchange runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: ${{fromJson(needs.getchange.outputs.matrix)}} steps: - uses: actions/checkout@v2