diff --git a/.github/workflows/NativePipeline.yml b/.github/workflows/NativePipeline.yml index 94239965b..fa9609d1c 100644 --- a/.github/workflows/NativePipeline.yml +++ b/.github/workflows/NativePipeline.yml @@ -1,6 +1,17 @@ name: Run Native Pipeline on: workflow_dispatch: + inputs: + nt_branch: + description: "Native Template branch to use (default: master)" + default: "master" + required: false + type: string + + workspaces: + description: "Add comma-separated list of workspaces to run (animation-native,video-player-native, etc..)" + required: false + default: "*-native" # schedule: # - cron: "0 6 * * *" @@ -23,16 +34,31 @@ jobs: - name: "Determine scope" id: scope run: | - echo "Event name: '${{ github.event_name }}'" - if [ "${{ github.event_name }}" == "pull_request" ]; then - echo "scope=--since --include '*-native'" >> $GITHUB_OUTPUT + if [ "${{ github.event.inputs.workspaces }}" != "*-native" ]; then + selected_workspaces=${{ github.event.inputs.workspaces }} + echo "scope=--include ${selected_workspaces}" >> $GITHUB_ENV else - echo "scope=--include '*-native'" >> $GITHUB_OUTPUT + if [ "${{ github.event_name }}" == "pull_request" ]; then + echo "scope=--since --include '*-native'" >> $GITHUB_ENV + else + echo "scope=--include '*-native'" >> $GITHUB_ENV + fi fi - name: "Debug Scope Output" run: | - echo "Scope is: ${{ steps.scope.outputs.scope }}" + echo "Scope is: $scope" + printenv + + - name: "Set Test Scope" + run: | + echo "scope=--include rating-native" >> $GITHUB_ENV + + - name: "Debug Scope Output" + run: | + echo "Scope is: ${{ env.scope }}" + printenv + mendix-version: runs-on: ubuntu-22.04 steps: @@ -95,9 +121,9 @@ jobs: - name: "Install dependencies" run: yarn install --immutable - name: "Unit test" - run: yarn workspaces foreach ${{ needs.scope.outputs.scope }} run test + run: yarn workspaces foreach ${{ env.scope }} run test - name: "Run build for development" - run: yarn workspaces foreach ${{ needs.scope.outputs.scope }} run build + run: yarn workspaces foreach ${{ env.scope }} run build env: NODE_OPTIONS: --max_old_space_size=6144 - name: "Upload resources artifact" @@ -197,7 +223,7 @@ jobs: uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 with: repository: mendix/native-template - ref: master + ref: ${{ github.event.inputs.nt_branch || 'master' }} path: native-template - name: "Check out code" uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 @@ -246,7 +272,7 @@ jobs: uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 with: repository: mendix/native-template - ref: master + ref: ${{ github.event.inputs.nt_branch || 'master' }} path: native-template - name: "Check out code" uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3