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

MinGWビルドを引っ越しする #983

Merged
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
2 changes: 0 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ platform:
- BuildChm
- Win32
- x64
- MinGW

# set clone depth
clone_depth: 5
Expand All @@ -28,7 +27,6 @@ skip_commits:
install:
- cmd: |
pip install openpyxl --user
C:\msys64\usr\bin\bash --login -c "pacman -S --noconfirm mingw-w64-x86_64-gtest"

# to run our custom scripts instead of automatic MSBuild
build_script:
Expand Down
9 changes: 9 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ jobs:
vmImage: 'VS2017-Win2016'
displayName: VS2017

# サクラエディタのビルドを行う JOB(MinGW)
# * サクラエディタ本体
# * 単体テスト
- template: ci/azure-pipelines/template.job.build-on-msys2.yml
parameters:
name: MinGW
vmImage: 'VS2017-Win2016'
displayName: MinGW

# SonarQube で解析を行う JOB
- template: ci/azure-pipelines/template.job.SonarQube.yml
parameters:
Expand Down
5 changes: 5 additions & 0 deletions build-gnu.bat
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ if "%configuration%" == "Release" (
exit /b 1
)

@rem remove sh.exe in the PATH(for azure pipelines).
PATH=%PATH:C:\Program Files\Git\cmd;=%
PATH=%PATH:C:\Program Files\Git\usr\bin;=%
PATH=%PATH:C:\Program Files\Git\bin;=%

@rem https://www.appveyor.com/docs/environment-variables/
@rem path=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%path%
path=C:\msys64\mingw64\bin;%path%
Expand Down
80 changes: 80 additions & 0 deletions ci/azure-pipelines/template.job.build-on-msys2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# see https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops&viewFallbackFrom=vsts#passing-parameters
parameters:
name: ''
vmImage: ''
displayName: ''

jobs:
- job: ${{ parameters.name }}
displayName: ${{ parameters.displayName }}
dependsOn: script_check
pool:
vmImage: ${{ parameters.vmImage }}

strategy:
maxParallel: 2
matrix:
MinGW_Debug:
BuildPlatform: 'MinGW'
Configuration: 'Debug'
MinGW_Release:
BuildPlatform: 'MinGW'
Configuration: 'Release'

steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: all # what to clean each time; if not mentioned, does not clean
fetchDepth: 5 # the depth of commits to ask Git to fetch; defaults to no limit

# show environmental variables for debug.
- script: set
displayName: Show environmental variables for debug

- template: /ci/azure-pipelines/template.steps.install-mingw-w64-gcc.yml

# Build GNU C++
- script: build-gnu.bat $(BuildPlatform) $(Configuration)
displayName: Build with MinGW-w64-gcc

# Unit tests
- script: tests\build-and-test.bat $(BuildPlatform) $(Configuration)
displayName: Unit test

# see https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/copy-files?view=azure-devops&tabs=yaml
#
# "condition:" に関しては以下を参照
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&tabs=yaml
#
# "succeededOrFailed()" に関しては以下を参照
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&tabs=yaml#job-status-functions
#
- task: CopyFiles@1
condition: succeededOrFailed()
displayName: Copy to ArtifactStagingDirectory
inputs:
contents: |
**.zip
**.zip.md5
targetFolder: $(Build.ArtifactStagingDirectory)

# see https://docs.microsoft.com/en-us/azure/devops/pipelines/artifacts/build-artifacts?view=azure-devops&tabs=yaml
- task: PublishBuildArtifacts@1
condition: succeededOrFailed()
displayName: Publish ArtifactStagingDirectory
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: $(BuildPlatform)_$(Configuration)

# see https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=yaml
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/*-googletest-*.xml'
#searchFolder: '$(System.DefaultWorkingDirectory)' # Optional
#mergeTestResults: false # Optional
#failTaskOnFailedTests: false # Optional
#testRunTitle: # Optional
#buildPlatform: # Optional
#buildConfiguration: # Optional
#publishRunAttachments: true # Optional
18 changes: 18 additions & 0 deletions ci/azure-pipelines/template.steps.install-mingw-w64-gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#############################################################################################################
# 必要な mingw-w64-gcc をインストール手順の 'steps' を定義するテンプレート
#
# parameters
# なし
#############################################################################################################
steps:
- script: cinst msys2 --params "/InstallDir=C:/msys64" --no-progress
displayName: install msys2

- script: C:\msys64\usr\bin\bash --login -c "pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-libs"
displayName: install MinGW-w64-gcc

- script: C:\msys64\usr\bin\bash --login -c "pacman -S --noconfirm mingw-w64-x86_64-make"
displayName: install MinGW-w64-make

- script: C:\msys64\usr\bin\bash --login -c "pacman -S --noconfirm mingw-w64-x86_64-gtest"
displayName: install MinGW-w64-gtest