Test branch (#2)

This commit is contained in:
Nikita Bykov
2020-09-08 11:22:39 +03:00
committed by GitHub
parent 5d5ff87b28
commit dc8da2cb3a
5 changed files with 124 additions and 101 deletions

View File

@@ -1,12 +1,11 @@
name: Generate Boost package name: Generate Boost package
on: on:
push:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
VERSION: VERSION:
description: 'Boost version to build and upload' description: 'Boost version to build and upload'
required: true required: true
default: '1.15.0' default: '1.73.0'
PUBLISH_RELEASES: PUBLISH_RELEASES:
description: 'Whether to publish releases' description: 'Whether to publish releases'
required: true required: true
@@ -20,14 +19,31 @@ defaults:
jobs: jobs:
build_boost: build_boost:
name: Build Boost ${{ github.event.inputs.VERSION }} [${{ matrix.platform }}] name: Build Boost ${{ github.event.inputs.VERSION }} [${{ matrix.os }}]
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
env: env:
ARTIFACT_NAME: Boost-${{ github.event.inputs.VERSION }}-${{ matrix.platform }}-x64 ARTIFACT_NAME: boost-${{ github.event.inputs.VERSION }}-${{ matrix.platform }}-${{ matrix.toolset }}-${{ matrix.architecture }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [linux, darwin, win32] include:
- os: ubuntu-16.04
architecture: x64
toolset: gcc
platform: linux-16.04
- os: ubuntu-18.04
architecture: x64
toolset: gcc
platform: linux-18.04
- os: windows-2016
architecture: x86_64
toolset: msvc-14.1
platform: win32
- os: windows-2019
architecture: x86_64
toolset: msvc-14.2
platform: win32
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
@@ -36,81 +52,94 @@ jobs:
- name: Build Boost ${{ env.VERSION }} - name: Build Boost ${{ env.VERSION }}
run: | run: |
./builders/build-boost.ps1 -Version $env:VERSION ` ./builders/build-boost.ps1 -Version $env:VERSION `
-Platform ${{ matrix.platform }} -Platform ${{ matrix.platform }} `
-Architecture ${{ matrix.architecture }} `
-Toolset ${{ matrix.toolset }}
- name: Publish artifact - name: Publish artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: ${{ env.ARTIFACT_NAME }} name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/artifact path: ${{ runner.temp }}/artifact
# test_boost: test_boost:
# name: Test Boost ${{ github.event.inputs.VERSION }} [${{ matrix.platform }}] name: Test Boost ${{ github.event.inputs.VERSION }} [${{ matrix.platform }}]
# needs: build_boost needs: build_boost
# runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
# env: env:
# ARTIFACT_NAME: boost-${{ github.event.inputs.VERSION }}-${{ matrix.platform }}-x64 PLATFORM: ${{ matrix.platform }}
# strategy: ARTIFACT_NAME: boost-${{ github.event.inputs.VERSION }}-${{ matrix.platform }}-${{ matrix.toolset }}-${{ matrix.architecture }}
# fail-fast: false strategy:
# matrix: fail-fast: false
# include: matrix:
# - os: ubuntu-latest include:
# platform: linux - os: ubuntu-16.04
# - os: macos-latest platform: linux-16.04
# platform: darwin toolset: gcc
# - os: windows-latest architecture: x64
# platform: win32 - os: ubuntu-18.04
# steps: platform: linux-18.04
# - uses: actions/checkout@v2 toolset: gcc
# with: architecture: x64
# submodules: true - os: windows-2016
platform: win32
toolset: msvc-14.1
architecture: x86_64
- os: windows-2019
platform: win32
toolset: msvc-14.2
architecture: x86_64
steps:
- uses: actions/checkout@v2
with:
submodules: true
# - name: Fully cleanup the toolcache directory before testing - name: Fully cleanup the toolcache directory before testing
# run: ./helpers/clean-toolcache.ps1 -ToolName "boost" run: ./helpers/clean-toolcache.ps1 -ToolName "boost"
# - name: Download artifact - name: Download artifact
# uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
# with: with:
# path: ${{ runner.temp }} path: ${{ runner.temp }}
# - name: Extract files - name: Extract files
# run: | run: |
# if ('${{ matrix.platform }}' -eq 'win32') { $artifactName = "${{ env.ARTIFACT_NAME }}.tar.gz"
# $artifactName = "${{ env.ARTIFACT_NAME }}.zip" tar -xzf $artifactName
# 7z.exe x "$artifactName" -y | Out-Null working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
# } else {
# $artifactName = "${{ env.ARTIFACT_NAME }}.tar.gz"
# tar -xzf $artifactName
# }
# working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
# - name: Apply build artifact to the local machine - name: Apply build artifact to the local machine
# run: | run: |
# if ('${{ matrix.platform }}' -eq 'win32') { powershell ./setup.ps1 } else { sh ./setup.sh } if ('${{ matrix.platform }}' -eq 'win32') { powershell ./setup.ps1 } else { sh ./setup.sh }
# working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }} working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
# - name: Setup Boost ${{ env.VERSION }} - name: Setup BOOST_ROOT ${{ github.event.inputs.VERSION }}
# uses: actions/setup-boost@v2.1.1 run: |
# with: $targetPath = $env:AGENT_TOOLSDIRECTORY
# boost-version: ${{ env.VERSION }} if ([string]::IsNullOrEmpty($targetPath)) {
# GitHub Windows images don't have `AGENT_TOOLSDIRECTORY` variable
$targetPath = $env:RUNNER_TOOL_CACHE
}
$BoostToolcachePath = Join-Path -Path $targetPath -ChildPath "boost"
$BoostToolcacheVersionPath = Join-Path -Path $BoostToolcachePath -ChildPath "${{ github.event.inputs.VERSION }}"
$boostDirectory = Join-Path $BoostToolcacheVersionPath "${{ matrix.architecture }}"
$LD_LIBRARY = Join-Path -Path $boostDirectory -ChildPath "lib"
Write-Host "BOOST_ROOT = ${boostDirectory}"
echo "::set-env name=BOOST_ROOT::${boostDirectory}"
echo "::set-env name=LD_LIBRARY_PATH::${LD_LIBRARY}"
# - name: Wait for the logs - name: Run tests
# run: | run: |
# Write-Host "Fake step that do nothing" Install-Module Pester -Force -Scope CurrentUser
# Write-Host "We need it because log of previous step 'Setup Boost' is not available here yet." Import-Module Pester
# Write-Host "In testing step (Boost.Tests.ps1) we analyze build log of 'Setup Boost' task" $Platform = If ("${{ matrix.platform }}" -eq "win32") { "Windows" } else { "Nix" }
# Write-Host "to determine if Boost.js version was consumed from cache and was downloaded" Invoke-Pester -Script ./Common.Tests.ps1 -EnableExit
# for ($i = 0; $i -lt 200; $i++) { Get-Random } Invoke-Pester -Script "./${Platform}.Tests.ps1" -EnableExit
# - name: Run tests working-directory: ./tests
# run: |
# Install-Module Pester -Force -Scope CurrentUser
# Import-Module Pester
# Invoke-Pester -Script ./Boost.Tests.ps1 -EnableExit
# working-directory: ./tests
publish_release: publish_release:
name: Publish release name: Publish release
if: github.event.inputs.PUBLISH_RELEASES == 'true' if: github.event.inputs.PUBLISH_RELEASES == 'true'
# needs: test_boost needs: test_boost
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2

View File

@@ -20,7 +20,7 @@ jobs:
./helpers/packages-generation/manifest-generator.ps1 -RepositoryFullName "$env:GITHUB_REPOSITORY" ` ./helpers/packages-generation/manifest-generator.ps1 -RepositoryFullName "$env:GITHUB_REPOSITORY" `
-GitHubAccessToken "${{secrets.GITHUB_TOKEN}}" ` -GitHubAccessToken "${{secrets.GITHUB_TOKEN}}" `
-OutputFile "./versions-manifest.json" ` -OutputFile "./versions-manifest.json" `
-ConfigurationFile "./config/go-manifest-config.json" -ConfigurationFile "./config/boost-manifest-config.json"
- name: Create GitHub PR - name: Create GitHub PR
run: | run: |
$formattedDate = Get-Date -Format "MM/dd/yyyy" $formattedDate = Get-Date -Format "MM/dd/yyyy"

View File

@@ -16,13 +16,13 @@ class BoostBuilder {
The architecture with which Boost should be built. The architecture with which Boost should be built.
.PARAMETER TempFolderLocation .PARAMETER TempFolderLocation
The location of temporary files that will be used during Go package generation. The location of temporary files that will be used during Boost package generation.
.PARAMETER WorkFolderLocation .PARAMETER WorkFolderLocation
The location of installation files. The location of installation files.
.PARAMETER ArtifactFolderLocation .PARAMETER ArtifactFolderLocation
The location of generated Go artifact. The location of generated Boost artifact.
.PARAMETER InstallationTemplatesLocation .PARAMETER InstallationTemplatesLocation
The location of installation script template. Using "installers" folder from current repository. The location of installation script template. Using "installers" folder from current repository.

View File

@@ -1,18 +1,15 @@
param (
[Version] $Version,
[String] $Platform
)
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1") Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
Set-Location "sources" BeforeAll {
$env:Path="$env:Path;${env:BOOST_ROOT}\lib" Set-Location "sources"
$env:Path="$env:Path;${env:BOOST_ROOT}\lib"
if (${env:PLATFORM} -eq "linux-16.04") {
Write-Host "Install dependencies"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 `
--slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --config gcc
}
if ($Platform -eq "linux-16.04") {
Write-Host "Install dependencies"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 `
--slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --config gcc
} }
Describe "Nix Tests" { Describe "Nix Tests" {
@@ -33,10 +30,10 @@ Describe "Nix Tests" {
"-w", "-DBOOST_LOG_DYN_LINK", "-w", "-DBOOST_LOG_DYN_LINK",
"-I", "${env:BOOST_ROOT}/include", "-I", "${env:BOOST_ROOT}/include",
"-L", "${env:BOOST_ROOT}/lib", "main_log.cpp", "-L", "${env:BOOST_ROOT}/lib", "main_log.cpp",
"-l:libboost_log_setup-mt-d-x64.so.${Version}", "-l:libboost_log_setup-mt-d-x64.so.${env:VERSION}",
"-l:libboost_log-mt-d-x64.so.${Version}", "-l:libboost_log-mt-d-x64.so.${env:VERSION}",
"-l:libboost_thread-mt-d-x64.so.${Version}", "-l:libboost_thread-mt-d-x64.so.${env:VERSION}",
"-l:libboost_filesystem-mt-d-x64.so.${Version}", "-l:libboost_filesystem-mt-d-x64.so.${env:VERSION}",
"-lpthread" "-lpthread"
) )
@@ -49,10 +46,10 @@ Describe "Nix Tests" {
"-w", "-DBOOST_LOG_DYN_LINK", "-w", "-DBOOST_LOG_DYN_LINK",
"-I", "${env:BOOST_ROOT}/include", "-I", "${env:BOOST_ROOT}/include",
"-L", "${env:BOOST_ROOT}/lib", "main_log.cpp", "-L", "${env:BOOST_ROOT}/lib", "main_log.cpp",
"-l:libboost_log_setup-mt-x64.so.${Version}", "-l:libboost_log_setup-mt-x64.so.${env:VERSION}",
"-l:libboost_log-mt-x64.so.${Version}", "-l:libboost_log-mt-x64.so.${env:VERSION}",
"-l:libboost_thread-mt-x64.so.${Version}", "-l:libboost_thread-mt-x64.so.${env:VERSION}",
"-l:libboost_filesystem-mt-x64.so.${Version}", "-l:libboost_filesystem-mt-x64.so.${env:VERSION}",
"-lpthread" "-lpthread"
) )

View File

@@ -1,17 +1,14 @@
param (
[Version] $Version,
[String] $Platform
)
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1") Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
Import-Module (Join-Path $PSScriptRoot "../helpers/win-vs-env.psm1") Import-Module (Join-Path $PSScriptRoot "../helpers/win-vs-env.psm1")
Set-Location -Path "sources" BeforeAll {
Set-Location -Path "sources"
$env:Path="$env:Path;${env:BOOST_ROOT}\lib" $env:Path="$env:Path;${env:BOOST_ROOT}\lib"
Write-Host "Initialize VS dev environment" Write-Host "Initialize VS dev environment"
Invoke-VSDevEnvironment Invoke-VSDevEnvironment
}
Describe "Windows Tests" { Describe "Windows Tests" {
It "Run simple code" { It "Run simple code" {
@@ -24,7 +21,7 @@ Describe "Windows Tests" {
"/EHsc", "/EHsc",
"/I", "${env:BOOST_ROOT}\include", "/I", "${env:BOOST_ROOT}\include",
"main-headers.cpp", "main-headers.cpp",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib", "/link", "/LIBPATH:${env:BOOST_ROOT}\lib"
"/OUT:main_static_lib_1.exe" "/OUT:main_static_lib_1.exe"
) )
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode "cl -nologo $buildArguments" | Should -ReturnZeroExitCode
@@ -36,7 +33,7 @@ Describe "Windows Tests" {
"/EHsc", "/MD", "/EHsc", "/MD",
"/I", "${env:BOOST_ROOT}\include", "/I", "${env:BOOST_ROOT}\include",
"main-headers.cpp", "main-headers.cpp",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib", "/link", "/LIBPATH:${env:BOOST_ROOT}\lib"
"/OUT:main_dynamic_lib_1.exe" "/OUT:main_dynamic_lib_1.exe"
) )
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode "cl -nologo $buildArguments" | Should -ReturnZeroExitCode
@@ -48,7 +45,7 @@ Describe "Windows Tests" {
"/EHsc", "/EHsc",
"/I", "${env:BOOST_ROOT}\include", "/I", "${env:BOOST_ROOT}\include",
"main_log.cpp", "main_log.cpp",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib", "/link", "/LIBPATH:${env:BOOST_ROOT}\lib"
"/OUT:main_static_lib_2.exe" "/OUT:main_static_lib_2.exe"
) )
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode "cl -nologo $buildArguments" | Should -ReturnZeroExitCode
@@ -60,7 +57,7 @@ Describe "Windows Tests" {
"/EHsc", "/MD", "/EHsc", "/MD",
"/I", "${env:BOOST_ROOT}\include", "/I", "${env:BOOST_ROOT}\include",
"main_log.cpp", "main_log.cpp",
"/link", "/LIBPATH:${env:BOOST_ROOT}\lib", "/link", "/LIBPATH:${env:BOOST_ROOT}\lib"
"/OUT:main_dynamic_lib_2.exe" "/OUT:main_dynamic_lib_2.exe"
) )
"cl -nologo $buildArguments" | Should -ReturnZeroExitCode "cl -nologo $buildArguments" | Should -ReturnZeroExitCode