Skip to content

Commit

Permalink
Add input options for NT and workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaSimsic committed Sep 5, 2024
1 parent 5f899b3 commit 04ce1de
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions .github/workflows/NativePipeline.yml
Original file line number Diff line number Diff line change
@@ -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 * * *"
Expand All @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 04ce1de

Please sign in to comment.