diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a6eec329..9a0b7c32 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -16,7 +16,21 @@ jobs: id: changed-files uses: tj-actions/changed-files@v42 with: - files: packages/** + files_yaml: | + auth: + - 'packages/auth/**' + common: + - 'packages/common/**' + event-producer: + - 'packages/event-producer/**' + player: + - 'packages/player/**' + player-web-components: + - 'packages/player-web-components/**' + template: + - 'packages/template/**' + true-time: + - 'packages/true-time/**' # Optionally set `files_yaml_from_source_file` to read the YAML from a file. e.g `files_yaml_from_source_file: .github/changed-files.yml` - name: Run step if test file(s) change @@ -39,5 +53,7 @@ jobs: pull-requests: write needs: [ check-changes ] if: needs.changed-files.outputs.any_changed == 'true' + with: + modules: ${{ needs.check-changes.outputs.modules }} uses: ./.github/workflows/unit-test.yml secrets: inherit diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index f893528e..65846168 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -2,6 +2,11 @@ name: Run Unit Tests on: workflow_call: + inputs: + modules: + required: true + type: string + description: 'List of modules to run tests for' jobs: unit-tests: @@ -26,6 +31,7 @@ jobs: TEST_USER: ${{ secrets.PLAYER_TEST_USER }} - name: Run Tests run: | + echo "Running tests for ${{ inputs.modules }}" pnpm test:coverage env: TEST_USER: ${{ steps.json.outputs.encoded }}