Set python version based on file change

pull/607/head
Lucas Hiago 5 years ago
parent 606eb20f7c
commit 134d0ab464

@ -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

Loading…
Cancel
Save