diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index 6837e51..aed03d3 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -20,27 +20,27 @@ jobs: validate: runs-on: windows-latest steps: - - name: Checkout repo + - name: 🚚 Checkout repo uses: actions/checkout@v6 - - name: Set up Python 3.13 + - name: 📡 Set up Python 3.13 uses: actions/setup-python@v6 with: python-version: '3.13' # Uses the latest patch version of the given - - name: Install python modules + - name: 📡 Install python modules working-directory: . run: python -m pip install -r requirements.txt - - name: Validate folders of XML types (UDLs, autoCompletion, functionList) + - name: 🏃 Validate folders of XML types (UDLs, autoCompletion, functionList) working-directory: . run: python .validators\validator_xml.py - - name: Validate json and rebuild udl-list.md + - name: 🏃 Validate json and rebuild udl-list.md working-directory: . run: python .validators\validator_json.py - - name: Generate autoCompletion for all UDLs that don't already have one, and revalidate (primary repo + branch only) + - name: 🔨 Generate autoCompletion for all UDLs that don't already have one, and revalidate (primary repo + branch only) working-directory: . if: ${{ contains('push workflow_dispatch', github.event_name) && github.ref == 'refs/heads/master' && github.repository == 'notepad-plus-plus/userDefinedLanguages' }} run: | @@ -50,32 +50,39 @@ jobs: # since AC may have been added to JSON, need to revalidate JSON and re-generate md python .validators\validator_json.py - - name: Update repo with automated changes for the UDL list and autoCompletions + - name: 🎉 Update repo with automated changes for the UDL list and autoCompletions uses: stefanzweifel/git-auto-commit-action@v7 if: contains('push workflow_dispatch', github.event_name) with: commit_message: Automatically re-build udl-list.md and add new autoCompletions unitTest: + name: FunctionList Unit Tests runs-on: windows-latest needs: validate steps: - - name: Checkout repo + - name: 🚚 Checkout repo uses: actions/checkout@v6 with: fetch-depth: 0 - - name: Check for Changes in functionList Files + - name: 🔍 Check for Changes in functionList Files id: get_changes working-directory: . run: | # start assuming no changed FL files $any_changed = $false # + # validate event IDs before passing them to git diff: + git rev-parse --quiet --verify "${{ github.event.before }}^{commit}" >$null 2>&1 + $invalid1 = $LASTEXITCODE -ne 0 + git rev-parse --quiet --verify "${{ github.event.after }}^{commit}" >$null 2>&1 + $invalid2 = $LASTEXITCODE -ne 0 # grab the changes if("${{ github.event_name }}" -eq "workflow_dispatch" -or "${{ github.event.before }}" -eq "0000000000000000000000000000000000000000" -or - "${{ github.event.after }}" -eq "0000000000000000000000000000000000000000") { + "${{ github.event.after }}" -eq "0000000000000000000000000000000000000000" -or + $invalid1 -or $invalid2 ) { #Write-Output "non-push or invalid object: use HEAD~1..HEAD, which isn't as specific, but better than nothing" $changed_files = @( git diff --name-only HEAD~1..HEAD ) } else { @@ -97,12 +104,13 @@ jobs: echo "is_fl_changed=True" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append } - - name: Install Notepad++ + - name: 🦎 Install Notepad++ if: ${{ steps.get_changes.outputs.is_fl_changed }} uses: crazy-max/ghaction-chocolatey@v3 with: args: install -y notepadplusplus - - name: Run FunctionList Unit Tests + + - name: 🏃 Run FunctionList Unit Tests if: ${{ steps.get_changes.outputs.is_fl_changed }} working-directory: .\Test run: |