Skip to content

Commit

Permalink
try a different approach
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHaff committed Feb 27, 2024
1 parent 6045348 commit 168a312
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 6 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down

0 comments on commit 168a312

Please sign in to comment.