Skip to content
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7434050
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
65aed4b
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
c22e5cc
[xml]Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
86cb372
[force xml]Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
7203c8c
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
4c13756
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
a07e405
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
dff9b35
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
448ab25
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
4ad8770
[force xml]Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
1b6b61e
[force xml] Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
a80e637
[force xml] Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
5e00a8f
[force xml] Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
347edd7
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
6a0cf8e
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
5c3e8fa
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
9a4cc70
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
cdb128a
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
5b95491
[force xml] Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
62d550f
Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
8ea5095
[force xml]Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
b8e7ac7
[force none]Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
58af01e
[force one]Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
4a8cea9
[force one]Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
587329b
[force xml] Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
fe39f35
[force none]Update CI_build.yml
ArkadiuszMichalski Apr 23, 2024
56ccd7e
[force one]Update CI_build.yml
ArkadiuszMichalski Apr 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 83 additions & 20 deletions .github/workflows/CI_build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
name: CI_build

on: [push, pull_request]

jobs:
env:
PYTHON_ALLOW_CACHE: true
MSYS2_ALLOW_UPDATE: true
MSYS2_ALLOW_CACHE: true

jobs:
before_build:

runs-on: windows-latest
outputs:
result: ${{ steps.filter.outputs.result }}
matrix: ${{ steps.filter.outputs.matrix }}

title: ${{ steps.filter.outputs.title }}
python: ${{ steps.filter.outputs.python }}

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}

- name: Commit filtering
id: filter
run: |
Expand All @@ -23,7 +30,7 @@ jobs:
$folders_nowork = "\.github/ISSUE_TEMPLATE"
$files_nowork = "md|txt|log|ini"
$files_needwork = "CMakeLists\.txt"

$matrix_all = 'matrix={"build_configuration": ["Release", "Debug"], "build_platform": ["x64", "Win32", "ARM64"]}'
$matrix_onejob = 'matrix={"build_configuration": ["Debug"], "build_platform": ["Win32"]}'
Write-Output $matrix_all >> $env:GITHUB_OUTPUT
Expand All @@ -40,6 +47,7 @@ jobs:
}

$commit_title = ($commit_message -split "[\r\n]+")[0]
Write-Output "title=$commit_title" >> $env:GITHUB_OUTPUT
$files_modified = @(git diff --name-only HEAD~1)
$files_needwork_all = @($files_modified | Where-Object {$_ -notmatch "\.(xml|$files_nowork)$|$folders_nowork|$folders_onejob" -or $_ -match "($files_needwork)$"})

Expand All @@ -56,20 +64,12 @@ jobs:
if (@($files_modified | Where-Object {$_ -notmatch "\.($files_nowork)$|$folders_nowork"}).length -eq 0 -or $commit_title -match "\[force none\]") {
Write-Output "Changed files on this commit don't require any additional tasks.`n"
Write-Output "result=OK" >> $env:GITHUB_OUTPUT
Exit
}
else {
Write-Output "XML validation mode`n"
Write-Output "Run only XML validation step"
if (@($files_modified | Where-Object {$_ -match $folders_onejob}).length -eq 0) {
python -m pip install requests rfc3987 pywin32 lxml
python PowerEditor\Test\xmlValidator\validator_xml.py
if ($LastExitCode -eq 0) {
Write-Output "`nAll XML files are valid.`n"
Write-Output "result=OK" >> $env:GITHUB_OUTPUT
}
else {
Write-Output "`nSome XML files are invalid.`n"
$host.SetShouldExit($LastExitCode)
}
Write-Output "result=XML" >> $env:GITHUB_OUTPUT
}
else {
Write-Output "Run only one Win32/Debug job"
Expand All @@ -87,11 +87,62 @@ jobs:
Write-Output "Run standard jobs"
}

if ($Env:PYTHON_ALLOW_CACHE -eq "true") {
$python = ((python -V) -split " ")[1]
$requests = (Invoke-RestMethod https://pypi.org/pypi/requests/json).info.version
$rfc3987 = (Invoke-RestMethod https://pypi.org/pypi/rfc3987/json).info.version
$pywin32 = (Invoke-RestMethod https://pypi.org/pypi/pywin32/json).info.version
$lxml = (Invoke-RestMethod https://pypi.org/pypi/lxml/json).info.version
$key = "${{ runner.os }}-python_$python-rfc3987_$rfc3987-pywin32_$pywin32-lxml_$lxml"
Write-Output "python=$key" >> $env:GITHUB_OUTPUT
$needSavePythonCache = ((Invoke-WebRequest ${{ github.api_url }}/repos/${{ github.repository }}/actions/caches).content -notmatch "$key")
Write-Output "needSavePythonCache=$needSavePythonCache" >> $env:GITHUB_OUTPUT
}

- name: (cache) Restore Python modules
if: env.PYTHON_ALLOW_CACHE == 'true' && steps.filter.outputs.result == 'XML'
uses: actions/cache/restore@v4
id: cache
with:
path: 'D:\.cache\python'
key: ${{ steps.filter.outputs.python }}

- name: (cache) Install Python modules
if: env.PYTHON_ALLOW_CACHE == 'true' && steps.filter.outputs.needSavePythonCache == 'true'
run: |
python -m pip install --target D:\.cache\python requests rfc3987 pywin32 lxml

- name: (cache) Save Python modules
if: env.PYTHON_ALLOW_CACHE == 'true' && steps.filter.outputs.needSavePythonCache == 'true' && github.event_name == 'push'
uses: actions/cache/save@v4
with:
path: 'D:\.cache\python'
key: ${{ steps.filter.outputs.python }}

- name: XML validation
if: steps.filter.outputs.result == 'XML'
run: |
if ($Env:PYTHON_ALLOW_CACHE -eq "true") {
$Env:PYTHONPATH="D:\.cache\python"
}
else {
python -m pip install requests rfc3987 pywin32 lxml
}
python PowerEditor\Test\xmlValidator\validator_xml.py
if ($LastExitCode -eq 0) {
Write-Output "`nAll XML files are valid.`n"

}
else {
Write-Output "`nSome XML files are invalid.`n"
$host.SetShouldExit($LastExitCode)
}

build_windows:

runs-on: windows-latest
needs: before_build
if: needs.before_build.outputs.result == '' || needs.before_build.outputs.result == 'ONEJOB'
if: (needs.before_build.outputs.result == '' || needs.before_build.outputs.result == 'ONEJOB')
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.before_build.outputs.matrix) }}
Expand Down Expand Up @@ -149,14 +200,26 @@ jobs:
name: Notepad++.MSVC.${{ matrix.build_platform}}.${{ matrix.build_configuration}}
path: PowerEditor\visual.net\${{ matrix.build_configuration}}\Notepad++.exe

- name: (cache) Restore Python modules for Win32 / Debug
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Debug' && env.PYTHON_ALLOW_CACHE == 'true'
uses: actions/cache/restore@v4
id: cache
with:
path: 'D:\.cache\python'
key: ${{ needs.before_build.outputs.python }}

- name: Run xml validation test for Win32 / Debug only
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Debug'
working-directory: .\
run: |
python -m pip install requests rfc3987 pywin32 lxml
if ($Env:PYTHON_ALLOW_CACHE -eq "true") {
$Env:PYTHONPATH="D:\.cache\python"
}
else {
python -m pip install requests rfc3987 pywin32 lxml
}
python PowerEditor\Test\xmlValidator\validator_xml.py


- name: Run FunctionList and UrlDetection Tests for Win32 / Debug only
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Debug'
working-directory: .\
Expand Down Expand Up @@ -212,7 +275,7 @@ jobs:

runs-on: windows-latest
needs: before_build
if: needs.before_build.outputs.result == ''
if: needs.before_build.outputs.result == '' && 0
strategy:
matrix:
include:
Expand Down Expand Up @@ -266,7 +329,7 @@ jobs:

runs-on: windows-latest
needs: before_build
if: needs.before_build.outputs.result == ''
if: needs.before_build.outputs.result == '' && 0
strategy:
fail-fast: false
matrix:
Expand Down