Skip to content

Add python3

Add python3 #135

Workflow file for this run

# Build encoding converters and run tests
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: "./EncConverters 2019.sln"
jobs:
build-windows:
runs-on: windows-2019 # [windows-latest] # VS 2022 doesn't automatically include the proper .net framework
strategy:
# Keep building other jobs even if another fails, to show what _is_ still working.
fail-fast: false
matrix:
build_configuration: ["Debug", "Release"]
build_platform: ["Win32", "x64"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Fetch nuget dependecies
run: nuget restore "${{env.SOLUTION_FILE_PATH}}"
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{matrix.build_configuration}} /p:Platform=${{ matrix.build_platform }} "${{env.SOLUTION_FILE_PATH}}"
- name: Copy files to common location
run: |
xcopy /y .\output\${{ matrix.build_platform }}\${{ matrix.build_configuration }}\* .\Common\${{ matrix.build_platform }}\${{ matrix.build_configuration }}\
- name: Wait for Matrix Files to be copied
if: matrix.build_configuration == 'Release' && matrix.build_platform == 'x64'
run: |
$timeout = 0
while ($timeout -lt 4*60) {
$Win32Debug = (Test-Path -Path '.\Common\Win32\Debug\TestEncCnvtrs.dll')
$Win32Release = (Test-Path -Path '.\Common\Win32\Release\TestEncCnvtrs.dll')
$x64Debug = (Test-Path -Path '.\Common\x64\Debug\TestEncCnvtrs.dll')
'$Win32Debug: ' + $Win32Debug
'$Win32Release: ' + $Win32Release
'$x64Debug: ' + $x64Debug
if ($Win32Debug -And $Win32Release -And $x64Debug) {
Write-Host "All required files exist, continuing..."
exit 0
} else {
Write-Host "Waiting for files to exist..."
Get-ChildItem -Path .\Common
Start-Sleep -Seconds 5
$timeout += 5
}
}
Write-Host "Timed out waiting for files to exist."
exit 0
- name: Copy files back for nuget packaging (bkz nuspec is looking for them in the output folder) during the 'Release' build (bkz both platforms will have been finished by then)
run: xcopy /s /y .\Common\* .\output
if: matrix.build_configuration == 'Release' && matrix.build_platform == 'x64'
- name: List Files in Repository
run: dir /s
shell: cmd
- name: Create NuGet Package
run: nuget pack ./Package.${{matrix.build_configuration}}.nuspec -OutputDirectory ./output/${{matrix.build_configuration}}
if: matrix.build_configuration == 'Release' && matrix.build_platform == 'x64'
- name: Upload NuGet Package as Artifact
uses: actions/upload-artifact@v2
if: matrix.build_configuration == 'Release' && matrix.build_platform == 'x64'
with:
name: ${{matrix.build_configuration}}-nuget-package
path: ./output/${{matrix.build_configuration}}/*.nupkg
# TODO Run tests
#- name: Test
# run: output/Win32/${{matrix.build_configuration}}/RunTests.exe
build-linux:
runs-on: [ubuntu-20.04]
strategy:
matrix:
build_configuration: ["Debug", "Release"]
steps:
- name: Add repo packages.sil.org
run: |
(wget -O- https://packages.sil.org/keys/pso-keyring-2016.gpg | sudo tee /etc/apt/trusted.gpg.d/pso-keyring-2016.gpg)&>/dev/null
(. /etc/os-release && sudo tee /etc/apt/sources.list.d/packages-sil-org.list>/dev/null <<< "deb http://packages.sil.org/$ID $VERSION_CODENAME main")
sudo apt-get update
- name: Install dependencies
run: sudo apt-get install --assume-yes automake g++ python2-dev python2 libicu-dev mono5-sil icu-dev-fw libteckit-dev
- name: Checkout
uses: actions/checkout@v2
- name: List Files in Repository
run: ls -R
- name: Restore NuGet Packages
run: nuget restore "${{env.SOLUTION_FILE_PATH}}"
- name: Autogen
run: . environ && ./autogen.sh
- name: Build
run: . environ && make
- name: Test
if: matrix.build_configuration == 'Debug'
run: |
. environ
export EC_COMMON_APPLICATION_DATA_PATH="$(pwd)/ec-common"
export MONO_REGISTRY_PATH="${EC_COMMON_APPLICATION_DATA_PATH}/registry"
cp -a src/RunTests/bin/x64/${{matrix.build_configuration}}/RunTests.exe output/x64/${{matrix.build_configuration}}/
# Note that currently, many tests fail and it doesn't fail this build step.
mono output/x64/${{matrix.build_configuration}}/RunTests.exe