Automate testing of initial sprints in tools module #2904
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: Validate PR Metadata | |
| on: | |
| pull_request_target: | |
| types: | |
| - labeled | |
| - unlabeled | |
| - opened | |
| - edited | |
| - reopened | |
| jobs: | |
| validate_pr_metadata: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: CodeYourFuture/actions/validate-pr-metadata@main | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| test_sdc_tasks: | |
| name: Test SDC Tasks | |
| runs-on: ubuntu-slim | |
| permissions: | |
| pull-requests: write | |
| needs: [validate_pr_metadata] | |
| if: ${{ github.event.label.name == 'Needs Review' }} | |
| steps: | |
| - name: checkout base branch | |
| uses: actions/checkout@v5 | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@v47.0.5 | |
| - name: test individual shell tools | |
| id: test-individual-shell-tools | |
| if: contains(steps.changed-files.outputs.modified_files, 'individual-shell-tools/') | |
| run: ./test-sdc.sh individual-shell-tools | |
| shell: bash | |
| - name: test jq | |
| id: test-jq | |
| if: contains(steps.changed-files.outputs.modified_files, 'jq/') | |
| run: ./test-sdc.sh jq | |
| shell: bash | |
| - name: test shell-pipelines | |
| id: test-shell-pipelines | |
| if: contains(steps.changed-files.outputs.modified_files, 'shell-pipelines/') | |
| run: ./test-sdc.sh shell-pipelines | |
| shell: bash | |
| - name: test number-systems | |
| id: test-number-systems | |
| if: contains(steps.changed-files.outputs.modified_files, 'number-systems/') | |
| run: ./test-sdc.sh number-systems | |
| shell: bash | |
| - name: make output comment | |
| if: steps.test-individual-shell-tools.outputs.attempted == 'y' || steps.test-jq.outputs.attempted == 'y' || steps.test-shell-pipelines.outputs.attempted == 'y' || steps.test-number-systems.outputs.attempted == 'y' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| ISSUE_URL: ${{ github.event.pull_request.html_url }} | |
| run: | | |
| gh pr comment $ISSUE_URL --body-file testoutput.txt | |
| - name: add appropriate labels | |
| if: steps.test-individual-shell-tools.outputs.complete == 'y' || steps.test-jq.outputs.complete == 'y' || steps.test-shell-pipelines.outputs.complete == 'y' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| ISSUE_URL: ${{ github.event.pull_request.html_url }} | |
| run: | | |
| gh pr edit $ISSUE_URL --add-label "Complete" | |
| gh pr edit $ISSUE_URL --remove-label "Needs Review" | |
| - name: fail if not complete | |
| if: (steps.test-individual-shell-tools.outputs.attempted == 'y' || steps.test-jq.outputs.attempted == 'y' || steps.test-shell-pipelines.outputs.attempted == 'y') && !(steps.test-individual-shell-tools.outputs.complete == 'y' || steps.test-jq.outputs.complete == 'y' || steps.test-shell-pipelines.outputs.complete == 'y') | |
| run: | | |
| exit -1 |