|
| 1 | +name: Node CI Workflow |
| 2 | +# |
| 3 | +# The parameters are defaulted at the org level but can be overridden on the repository. |
| 4 | +# See the github-automation repo for more documentation |
| 5 | +# |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - dev |
| 10 | + - main |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - dev |
| 14 | + - main |
| 15 | + issue_comment: |
| 16 | + types: [created] |
| 17 | + workflow_dispatch: |
| 18 | + inputs: |
| 19 | + workflowBranch: |
| 20 | + description: "Branch of the reusable workflow. Defaults to main, select dev for testing only." |
| 21 | + required: true |
| 22 | + default: "main" |
| 23 | + type: choice |
| 24 | + options: |
| 25 | + - dev |
| 26 | + - main |
| 27 | +jobs: |
| 28 | + echo-inputs: |
| 29 | + name: Repo Workflow Debugging |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - name: Check Repo Vars |
| 33 | + run: | |
| 34 | + echo "*** Start - Check inputs in repo workflow ***" |
| 35 | + echo "Node Version: ${{ vars.NODE_VERSION }}" |
| 36 | + echo "Lint Required: ${{ vars.IS_LINT_REQUIRED }}" |
| 37 | + echo "Format Check Required: ${{ vars.IS_FORMAT_CHECK_REQUIRED }}" |
| 38 | + echo "Apply Patches Required: ${{ vars.IS_APPLY_PATCHES_REQUIRED }}" |
| 39 | + echo "Unit Tests Required: ${{ vars.IS_UNIT_TESTS_REQUIRED }}" |
| 40 | + echo "*** End - Check inputs in repo workflow ***" |
| 41 | + ci-test-only: |
| 42 | + if: ${{ github.event.inputs.workflowBranch == 'dev' }} |
| 43 | + uses: shardeum/github-automation/.github/workflows/reusable-node-ci.yml@dev |
| 44 | + permissions: |
| 45 | + issues: write |
| 46 | + pull-requests: write |
| 47 | + contents: write |
| 48 | + with: |
| 49 | + node-version: ${{ vars.NODE_VERSION }} |
| 50 | + lint-required: ${{ vars.IS_LINT_REQUIRED == 'true' }} |
| 51 | + format-check-required: ${{ vars.IS_FORMAT_CHECK_REQUIRED == 'true' }} |
| 52 | + apply-patches-required: ${{ vars.IS_APPLY_PATCHES_REQUIRED == 'true' }} |
| 53 | + unit-tests-required: ${{ vars.IS_UNIT_TESTS_REQUIRED == 'true' }} |
| 54 | + secrets: inherit |
| 55 | + |
| 56 | + ci: |
| 57 | + if: ${{ github.event.inputs.workflowBranch == 'main' || !github.event.inputs.workflowBranch }} |
| 58 | + uses: shardeum/github-automation/.github/workflows/reusable-node-ci.yml@main |
| 59 | + permissions: |
| 60 | + issues: write |
| 61 | + pull-requests: write |
| 62 | + contents: write |
| 63 | + with: |
| 64 | + node-version: ${{ vars.NODE_VERSION }} |
| 65 | + lint-required: ${{ vars.IS_LINT_REQUIRED == 'true' }} |
| 66 | + format-check-required: ${{ vars.IS_FORMAT_CHECK_REQUIRED == 'true' }} |
| 67 | + apply-patches-required: ${{ vars.IS_APPLY_PATCHES_REQUIRED == 'true' }} |
| 68 | + unit-tests-required: ${{ vars.IS_UNIT_TESTS_REQUIRED == 'true' }} |
| 69 | + secrets: inherit |
0 commit comments