From 4df3b0fba78f551f126629e448bbd3706ea9ca93 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Tue, 8 Dec 2020 10:12:42 +0800 Subject: [PATCH] Add GitHub actions --- .github/workflows/build-test.yml | 67 ++++++++++++++++++++++++++++++++ test/Makemodule.am | 8 +++- 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-test.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 000000000..49146c926 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,67 @@ +name: Build and test + +on: [push, pull_request] + +jobs: + build-ubuntu: + name: Ubuntu 18.04 + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Install dependencies + run: sudo apt-get install automake flex llvm-dev check lcov + - name: Generate configure script + run: ./autogen.sh + - name: Configure + run: ./configure --enable-gcov --enable-vhpi --with-llvm=/usr/bin/llvm-config + - name: Build + run: make + - name: Test + run: make check + - name: Coverage report + run: make cov-generate + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: ./coverage/nvc.info + + build-mac: + name: Mac OS X + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Install dependencies + run: brew install llvm check automake + - name: Generate configure script + run: ./autogen.sh + - name: Configure + run: ./configure --enable-vhpi --with-llvm=$(brew --prefix llvm)/bin/llvm-config + - name: Build + run: make + - name: Test + run: make check + + build-windows: + name: Windows MSYS2 + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Add MSYS2 to path + run: $env:Path += ";C:\msys64\mingw64\bin;C:\msys64\usr\bin" + - name: Install dependencies + run: pacman --noconfirm -S mingw-w64-x86_64-{llvm,check} unzip + - name: Generate configure script + run: bash autogen.sh + - name: Configure + run: bash configure --enable-vhpi + - name: Build + run: make + - name: Test + run: make check diff --git a/test/Makemodule.am b/test/Makemodule.am index a25536131..01f9e358a 100644 --- a/test/Makemodule.am +++ b/test/Makemodule.am @@ -53,9 +53,13 @@ cov-reset: find $(top_builddir) -name '*.gcda' -exec rm {} \; lcov --directory $(build) --zerocounters -cov-report: +cov-generate: mkdir -p $(covdir) - lcov --directory $(build) --capture --output-file $(covdir)/nvc.info + lcov --directory $(build) --capture --output-file $(covdir)/nvc.raw.info + lcov --output-file $(covdir)/nvc.info --remove $(covdir)/nvc.raw.info \ + '/usr/*' $(build)/lexer.c + +cov-report: cov-generate genhtml -o $(covdir) $(covdir)/nvc.info -x-www-browser $(covdir)/index.html