Skip to content

Commit

Permalink
Add GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Dec 8, 2020
1 parent 0eb63c4 commit 118a0aa
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 7 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
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
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: msys2/setup-msys2@v2
with:
update: true
install: >-
base-devel
mingw-w64-x86_64-llvm
mingw-w64-x86_64-check
mingw-w64-x86_64-ncurses
mingw-w64-x86_64-libffi
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-gcc
unzip
git
- name: Generate configure script
run: bash autogen.sh
- name: Configure
run: bash configure --enable-vhpi
- name: Build}
run: make
- name: Test
run: make check
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Synopsis

[![Build Status](https://travis-ci.org/nickg/nvc.svg?branch=master)](https://travis-ci.org/nickg/nvc)
[![Windows status](https://ci.appveyor.com/api/projects/status/7eo8mjn98misbhva/branch/master?svg=true)](https://ci.appveyor.com/project/nickg72247/nvc/branch/master)
[![Build
Status](https://github.com/nickg/nvc/workflows/Build%20and%20test/badge.svg?branch=master)](https://github.com/nickg/nvc/actions)
[![Coverage Status](https://coveralls.io/repos/github/nickg/nvc/badge.svg?branch=master)](https://coveralls.io/github/nickg/nvc?branch=master)

NVC is a GPLv3 VHDL compiler and simulator aiming for IEEE 1076-2002 compliance. See
Expand Down Expand Up @@ -86,10 +86,10 @@ Windows support is via MinGW or [Cygwin](http://www.cygwin.com/).

If you do not already have Cygwin it is easiest to build for MinGW using
[MSYS2](https://msys2.github.io/). Install the following dependencies using
`pacman`. For 64-bit MSYS2 replace `i686` below with `x86_64`.
`pacman`.

pacman -S base-devel mingw-w64-i686-{llvm,ncurses,libffi,check,pkg-config}
export PATH=/mingw32/bin:$PATH # Or mingw64 for 64-bit
pacman -S base-devel mingw-w64-x86_64-{llvm,ncurses,libffi,check,pkg-config}
export PATH=/mingw64/bin:$PATH
mkdir build && cd build
../configure
make install
Expand Down
8 changes: 6 additions & 2 deletions test/Makemodule.am
Original file line number Diff line number Diff line change
Expand Up @@ -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/*' '*/lexer.c'

cov-report: cov-generate
genhtml -o $(covdir) $(covdir)/nvc.info
-x-www-browser $(covdir)/index.html

Expand Down

0 comments on commit 118a0aa

Please sign in to comment.