Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIでVS2022を利用したビルドを行うようにする #1777

Merged
5 commits merged into from Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 26 additions & 3 deletions .github/workflows/build-sakura.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ jobs:
build:
# The type of runner that the job will run on
name: MSBuild
runs-on: windows-latest
runs-on: ${{matrix.os}}

strategy:
matrix:
os:
- windows-2019
- windows-2022
config:
- Debug
- Release
Expand Down Expand Up @@ -89,14 +92,34 @@ jobs:
run: build-sln.bat ${{ matrix.platform }} ${{ matrix.config }}
shell: cmd

- name: Run unit tests
run: .\tests1.exe --gtest_output=xml:${{github.workspace}}\tests1.exe-googletest-${{matrix.platform}}-${{matrix.config}}.xml
working-directory: ${{github.workspace}}\${{matrix.platform}}\${{matrix.config}}
shell: pwsh

- name: Install Locale Emulator
run: choco install locale-emulator -y
shell: cmd
run: |
choco install autohotkey.install --confirm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この行は失敗することがあるようです。
PR自体の問題ではないと思いますが、
なんかしら対策がいるかも知れません。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/sakura-editor/sakura/runs/5152232672?check_suite_focus=true#step:7:30

The remote server returned an error: (524).

アクセス先からHTTP STATUS 524が返ってきたのではないかと思います。
https://support.cloudflare.com/hc/en-us/articles/115003011431-Troubleshooting-Cloudflare-5XX-errors#524error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTP524 = Gateway timeout
ゲートウェイが独自に定義したエラーコードのようです。

通信遅延の問題なので、対策はやっぱり「キャッシュする」なのかなぁ、とか(笑
#1777 (comment)

頻発するかどうか、様子見ですね。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.appveyor.com/docs/build-cache/#caching-chocolatey-packages
(既定では%TEMP%にダウンロードされる)パッケージインストーラをCIでキャッシュするのは推奨されないようですね。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%TEMP% はキャッシュしちゃいかんでしょ!
が良識だと思ってます。

どうやって実現するかは、また別な話だと思いました。

  • NuGetみたいにローカルパッケージを利用できないでしょうか。
  • NuGetみたいにパッケージソースを設定で上書きできないでしょうか。

$LEExpandDir = "${{github.workspace}}\tools\locale-emulator"
$LEInitScript = "${{github.workspace}}\ci\init-locale-emulator.ahk"
New-Item "${LEExpandDir}" -ItemType Directory
Invoke-WebRequest `
"https://github.com/xupefei/Locale-Emulator/releases/download/v2.5.0.1/Locale.Emulator.2.5.0.1.zip" `
-OutFile "${LEExpandDir}\locale-emulator.zip"
Expand-Archive "${LEExpandDir}\locale-emulator.zip" "${LEExpandDir}"
Start-Process "AutoHotKey" "${LEInitScript}"
Start-Process "${LEExpandDir}\LEInstaller.exe"
echo "${LEExpandDir}" >> $env:GITHUB_PATH
shell: pwsh

- name: Build HTML Help
run: build-chm.bat
shell: cmd

- name: Update/Install Inno Setup
run: choco upgrade innosetup --confirm
shell: pwsh

- name: Build installer with Inno Setup
run: build-installer.bat ${{ matrix.platform }} ${{ matrix.config }}
shell: cmd
Expand Down
7 changes: 7 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ jobs:
vmImage: 'windows-2019'
displayName: VS2019

# サクラエディタのビルドを行う JOB (VS2022)
- template: ci/azure-pipelines/template.job.build-unittest.yml
parameters:
name: VS2022
vmImage: 'windows-2022'
displayName: VS2022

# サクラエディタのビルドを行う JOB(MinGW)
# * サクラエディタ本体
# * 単体テスト
Expand Down
17 changes: 16 additions & 1 deletion ci/azure-pipelines/template.job.build-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,28 @@ jobs:
displayName: Bitmap Split/Mux

# Install Locale Emulator
- script: choco install locale-emulator -y
- pwsh: |
choco install autohotkey.install --confirm
$LEExpandDir = "$(Build.SourcesDirectory)\tools\locale-emulator"
$LEInitScript = "$(Build.SourcesDirectory)\ci\init-locale-emulator.ahk"
New-Item "${LEExpandDir}" -ItemType Directory
Invoke-WebRequest `
"https://github.com/xupefei/Locale-Emulator/releases/download/v2.5.0.1/Locale.Emulator.2.5.0.1.zip" `
-OutFile "${LEExpandDir}\locale-emulator.zip"
Expand-Archive "${LEExpandDir}\locale-emulator.zip" "${LEExpandDir}"
Copy link
Contributor

@berryzplus berryzplus Jan 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WebRequestは意外と頻繁に失敗するので、キャッシュを活用してはどうかな?と思いました。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今後それなりの頻度で失敗するようであれば、何かしらの対応を行うことにします。

Start-Process "AutoHotKey" "${LEInitScript}"
Start-Process "${LEExpandDir}\LEInstaller.exe"
echo "##vso[task.prependpath]${LEExpandDir}"
displayName: Install Locale Emulator

# Build HTML Help
- script: build-chm.bat
displayName: Build HTML Help

# Update/Install Inno Setup
- pwsh: choco upgrade innosetup --confirm
displayName: Update/Install Inno Setup

# Build installer with Inno Setup
- script: build-installer.bat $(BuildPlatform) $(Configuration)
displayName: Build installer with Inno Setup
Expand Down
7 changes: 7 additions & 0 deletions ci/init-locale-emulator.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#NoEnv
#NoTrayIcon
SetTitleMatchMode, 1

window_title = % "LE Context Menu Installer - V"
WinWait, %window_title%, , 20
WinClose %window_title%