Update build.yml #246
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
pull_request: | |
branches: | |
- master | |
- sr-64-github-action-coverage-reporter-crashing-on-windows | |
push: | |
tags: | |
- 'v*' | |
permissions: | |
contents: write | |
jobs: | |
build-windows: | |
runs-on: windows-2022 | |
steps: | |
# If this step breaks, try inspecting MSVC directory and consider changing appropriate paths. | |
# | |
# ls 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\' | |
# | |
# Since windows runner can be updated the version can change in future releases. | |
- name: Install SQLite3 + generate sqlite3.lib | |
run: | | |
choco install sqlite -y | |
cd C:\ProgramData\chocolatey\lib\SQLite\tools | |
ls 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\' | |
& 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\bin\Hostx64\x64\lib.exe' /DEF:sqlite3.def /OUT:sqlite3.lib /MACHINE:x64 | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: 1.9 | |
- name: Set PATH | |
run: | | |
$env:CRYSTAL_LIBRARY_PATH = (crystal env CRYSTAL_LIBRARY_PATH) + ";C:\ProgramData\chocolatey\lib\SQLite\tools" | |
Write-Host "crystal env: " + $(crystal env) | |
echo "CRYSTAL_LIBRARY_PATH='$(crystal env CRYSTAL_LIBRARY_PATH);C:\ProgramData\chocolatey\lib\SQLite\tools'" >> $env::GITHUB_ENV | |
Write-Host "crystal env: " + $(crystal env) | |
- run: shards install --production | |
- run: | | |
$env:CRYSTAL_LIBRARY_PATH = (crystal env CRYSTAL_LIBRARY_PATH) + ";C:\ProgramData\chocolatey\lib\SQLite\tools" | |
Write-Host "crystal env: " + $(crystal env) | |
echo "CRYSTAL_LIBRARY_PATH='$(crystal env CRYSTAL_LIBRARY_PATH);C:\ProgramData\chocolatey\lib\SQLite\tools'" >> $env::GITHUB_ENV | |
Write-Host "crystal env: " + $(crystal env) | |
crystal build src\cli.cr -o dist\coveralls --release --static --no-debug --progress -Dpreview_win32_delay_load | |
Write-Host "crystal env: " + $(crystal env) | |
- name: Copy dll | |
- run: cp "C:\ProgramData\chocolatey\lib\SQLite\tools\sqlite3.dll" dist\sqlite3.dll | |
- run: | | |
cd dist | |
tar -acf coveralls-windows.zip coveralls.exe sqlite3.dll | |
- name: Upload exe | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coveralls-windows.exe | |
path: dist/coveralls.exe | |
if-no-files-found: error | |
- name: Upload sqlite3.dll | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sqlite3.dll | |
path: dist/sqlite3.dll | |
if-no-files-found: error | |
- name: Upload zip | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coveralls-windows.zip | |
path: dist/coveralls-windows.zip | |
if-no-files-found: error | |