diff --git a/.github/workflows/build-utbot.yml b/.github/workflows/build-utbot.yml index d65963655..a9b1c6ce4 100644 --- a/.github/workflows/build-utbot.yml +++ b/.github/workflows/build-utbot.yml @@ -6,16 +6,7 @@ on: jobs: matrix-prep: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Read config from matrix.json - uses: actions/checkout@v2 - - id: set-matrix - run: | - TASKS=$(echo $(cat .github/workflows/matrix.json) | sed 's/ //g' ) - echo "::set-output name=matrix::$TASKS" + uses: ${{ $GITHUB_REPOSITORY }}.github/workflows/matrix-prep.yaml@${{ $GITHUB_SHA }} build: needs: matrix-prep diff --git a/.github/workflows/matrix-prep.yaml b/.github/workflows/matrix-prep.yaml new file mode 100644 index 000000000..bc035d98d --- /dev/null +++ b/.github/workflows/matrix-prep.yaml @@ -0,0 +1,19 @@ +name: Read config from matrix.json + +on: + push: + branches: + - '*' + +jobs: + matrix-prep: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Read config from matrix.json + uses: actions/checkout@v2 + - id: set-matrix + run: | + TASKS=$(echo $(cat .github/workflows/matrix.json) | sed 's/ //g' ) + echo "::set-output name=matrix::$TASKS" \ No newline at end of file diff --git a/.github/workflows/publish-base-env.yml b/.github/workflows/publish-base-env.yml index ef73d4972..06d34dbac 100644 --- a/.github/workflows/publish-base-env.yml +++ b/.github/workflows/publish-base-env.yml @@ -8,16 +8,7 @@ env: jobs: matrix-prep: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Read config from matrix.json - uses: actions/checkout@v2 - - id: set-matrix - run: | - TASKS=$(echo $(cat .github/workflows/matrix.json) | sed 's/ //g' ) - echo "::set-output name=matrix::$TASKS" + uses: ${{ $GITHUB_REPOSITORY }}.github/workflows/matrix-prep.yaml@${{ $GITHUB_SHA }} build-docker: needs: matrix-prep diff --git a/.github/workflows/publish-utbot.yml b/.github/workflows/publish-utbot.yml index cb0b1aa8e..47a942567 100644 --- a/.github/workflows/publish-utbot.yml +++ b/.github/workflows/publish-utbot.yml @@ -6,16 +6,7 @@ on: jobs: matrix-prep: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Read config from matrix.json - uses: actions/checkout@v2 - - id: set-matrix - run: | - TASKS=$(echo $(cat .github/workflows/matrix.json) | sed 's/ //g' ) - echo "::set-output name=matrix::$TASKS" + uses: ${{ $GITHUB_REPOSITORY }}.github/workflows/matrix-prep.yaml@${{ $GITHUB_SHA }} publish: needs: matrix-prep