@@ -28,7 +28,7 @@ concurrency:
2828 cancel-in-progress : true
2929
3030jobs :
31- validate :
31+ validate-githubhosted :
3232 name : ' Validate Changed Packages'
3333 if : ${{ ! contains(github.event.pull_request.labels.*.name, 'long-run') }}
3434 timeout-minutes : 640
8383 if : ${{ cancelled() }}
8484 run : |
8585 echo "Deleting stale CI org"
86-
86+
87+ validate-selfhosted :
88+ name : ' Validate Changed Packages'
89+ if : ${{ contains(github.event.pull_request.labels.*.name, 'long-run') }}
90+ timeout-minutes : 640
91+ runs-on : ubuntu-latest
92+ # container:
93+ # image: ${{ vars.SFP_IMAGE }}
94+ # credentials:
95+ # username: ${{ github.repository_owner }}
96+ # password: ${{ secrets.ACCESS_TOKEN }}
97+
98+ steps :
99+ - uses : actions/checkout@v4
100+ with :
101+ fetch-depth : 0
102+
103+ # New step: Scan sfdx-project.json for "replaceWithFile" entries and check if files exist
104+ - name : ' Check replaceWithFile existence in sfdx-project.json'
105+ id : check-replaceWithFile
106+ run : |
107+ # Extract "replaceWithFile" values from sfdx-project.json and check if the files exist
108+ shell : bash
109+
110+ - name : ' Get all changed files for this PR'
111+ id : changed-deployable-files
112+ uses : tj-actions/changed-files@v42
113+ with :
114+ files_ignore_from_source_file : validation-ignore-list.txt
115+ separator : " ,"
116+
117+ - name : ' Authenticate Dev Hub'
118+ run : |
119+ echo "Authenticating with Dev Hub"
120+
121+ # Validate source and trigger test, skipping if there are no deployable changes
122+ - name : ' If deployable changes were made, push source to a scratch org'
123+ run : |
124+ if [ "${{ steps.changed-deployable-files.outputs.all_changed_and_modified_files }}" == "" ]; then
125+ echo 'No deployable changes were made. Skipping Scratch Org Validation.'
126+ exit 0
127+ fi
128+ echo "Deploying source to a scratch org"
129+
130+ # Upload test results to the GitHub workspace
131+ - name : ' Upload test results'
132+ # uses: actions/upload-artifact@v4
133+ if : ${{ !cancelled() }}
134+ run : |
135+ echo "Dummy Uploading test results"
136+
137+ # If the job is cancelled, release the CI org
138+ - name : ' Delete stale CI org'
139+ if : ${{ cancelled() }}
140+ run : |
141+ echo "Deleting stale CI org"
87142
88143
89144 static-check :
0 commit comments