Merge pull request #13 from Runtime-Radar/optimize-detection #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test backend | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - auth-center/** | |
| - cluster-manager/** | |
| - cs-manager/** | |
| - event-processor/** | |
| - history-api/** | |
| - notifier/** | |
| - policy-enforcer/** | |
| - public-api/** | |
| - runtime-monitor/** | |
| pull_request: | |
| paths: | |
| - auth-center/** | |
| - cluster-manager/** | |
| - cs-manager/** | |
| - event-processor/** | |
| - history-api/** | |
| - notifier/** | |
| - policy-enforcer/** | |
| - public-api/** | |
| - runtime-monitor/** | |
| env: | |
| TASK_VERSION: '3.38.0' | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| contents: read | |
| outputs: | |
| components: ${{ steps.filter.outputs.changes }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - uses: dorny/paths-filter@v2 | |
| id: filter | |
| with: | |
| filters: | | |
| auth-center: ./auth-center/** | |
| cluster-manager: ./cluster-manager/** | |
| cs-manager: ./cs-manager/** | |
| event-processor: ./event-processor/** | |
| history-api: ./history-api/** | |
| notifier: ./notifier/** | |
| policy-enforcer: ./policy-enforcer/** | |
| public-api: ./public-api/** | |
| runtime-monitor: ./runtime-monitor/** | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: ${{ needs.changes.outputs.components != '[]' && needs.changes.outputs.components != '' }} | |
| strategy: | |
| matrix: | |
| # Parse JSON array containing names of all filters matching any of changed files | |
| # e.g. ['notifier', 'policy-enforcer'] if both component folders contains changes | |
| component: ${{ fromJSON(needs.changes.outputs.components) }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Install Task | |
| uses: go-task/setup-task@v1 | |
| with: | |
| version: ${{ env.TASK_VERSION }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Run Docker tests for ${{ matrix.component }} | |
| working-directory: ${{ matrix.component }} | |
| run: task test-docker |