Skip to content

Commit

Permalink
CI: Add ci for cmake on windows (verilator#2681) (verilator#3819)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kritik Bhimani authored Dec 23, 2022
1 parent 45abcb6 commit a86ded9
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# DESCRIPTION: Github actions config
# This name is key to badges in README.rst, so we use the name build
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0

name: msbuild

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # weekly

env:
CI_OS_NAME: win
CI_COMMIT: ${{ github.sha }}
CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_LIMIT_MULTIPLE: 0.95

defaults:
run:
working-directory: repo

jobs:

windows:
name: run on windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
path: repo
- name: Cache $CCACHE_DIR
uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: msbuild-msvc-cmake
- name: compile
env:
WIN_FLEX_BISON: ${{ github.workspace }}/.ccache
run: ./ci/ci-win-compile.ps1
- name: test build
run: ./ci/ci-win-test.ps1
- name: Zip up repository
run: Compress-Archive -LiteralPath install -DestinationPath verilator.zip
- name: Upload zip archive
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/repo/verilator.zip
name: verilator-win.zip
15 changes: 15 additions & 0 deletions ci/ci-win-compile.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
if (-Not (Test-Path $PWD/../.ccache/win_bison.exe)) {
git clone --depth 1 https://github.com/lexxmark/winflexbison
cd winflexbison
mkdir build
cd build
cmake .. --install-prefix $PWD/../../../.ccache
cmake --build . --config Release
cmake --install . --prefix $PWD/../../../.ccache
cd ../..
}
mkdir build
cd build
cmake .. --install-prefix $PWD/../install
cmake --build . --config Release
cmake --install . --prefix $PWD/../install
10 changes: 10 additions & 0 deletions ci/ci-win-test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cd install
$Env:VERILATOR_ROOT=$PWD
cd examples/cmake_tracing_c
mkdir build
cd build
cmake ..
cmake --build . --config Release
Release/example.exe
cd ..
Remove-Item -path build -recurse

0 comments on commit a86ded9

Please sign in to comment.