From 9d15385eb9f0cf79153e85b77633f9b432799f32 Mon Sep 17 00:00:00 2001 From: Zachary Snow Date: Tue, 5 Nov 2019 23:35:26 -0500 Subject: [PATCH] switch from Travis CI to GitHub Actions --- .github/workflows/test.yaml | 49 +++++++++++++++++++++++++++ .travis.yml | 67 ------------------------------------- 2 files changed, 49 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/test.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..31fd7f3 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,49 @@ +name: Test +on: push +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, macOS-10.14] + steps: + - uses: actions/checkout@v1 + - name: Install Dependencies + run: | + brew install haskell-stack shunit2 icarus-verilog || ls + sudo apt-get install -y haskell-stack shunit2 flex bison autoconf gperf || ls + - name: Cache iverilog + uses: actions/cache@v1 + with: + path: ~/.local + key: ${{ runner.OS }}-iverilog-10-2 + restore-keys: ${{ runner.OS }}-iverilog-10-2 + - name: Install iverilog + run: | + if [ "${{ runner.OS }}" = "Linux" ]; then + if [ ! -e "$HOME/.local/bin/iverilog" ]; then + curl --retry-max-time 60 -L https://github.com/steveicarus/iverilog/archive/v10_2.tar.gz > iverilog.tar.gz + tar -xzf iverilog.tar.gz + cd iverilog-10_2 + autoconf + ./configure --prefix=$HOME/.local + make + make install + cd .. + fi + fi + - name: Cache Build + uses: actions/cache@v1 + with: + path: ~/.stack + key: ${{ runner.OS }}-${{ hashFiles('**/stack.yaml') }}-${{ hashFiles('**/sv2v.cabal') }} + restore-keys: | + ${{ runner.OS }}-${{ hashFiles('**/stack.yaml') }}-${{ hashFiles('**/sv2v.cabal') }} + ${{ runner.OS }}-${{ hashFiles('**/stack.yaml') }}- + ${{ runner.OS }}- + - name: Build + run: make + - name: Test + run: | + export PATH="$PATH:$HOME/.local/bin" + make test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0cfc2a7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -language: generic - -matrix: - include: - - os: linux - dist: xenial - - os: osx - osx_image: xcode11 - -cache: - directories: - - $HOME/.stack - - $HOME/.local - -addons: - apt: - packages: - - shunit2 - # for stack - - libgmp-dev - # for iverilog - - flex - - bison - - autoconf - - gperf - homebrew: - packages: - - haskell-stack - - shunit2 - - icarus-verilog - -before_install: - - | - set -ex - if [ "$TRAVIS_OS_NAME" == "linux" ]; then - orig_pwd=$PWD - mkdir -p ~/.local/bin - export PATH=$HOME/.local/bin:$PATH - # install the latest version of stack - if [ ! -e "$HOME/.local/bin/stack" ]; then - # based on: https://raw.githubusercontent.com/commercialhaskell/stack/stable/doc/travis-simple.yml - travis_retry curl --retry-max-time 60 -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz > stack.tar.gz - tar -xzf stack.tar.gz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' - fi - # install iverilog 10.2 - if [ ! -e "$HOME/.local/bin/iverilog" ]; then - travis_retry curl --retry-max-time 60 -L https://github.com/steveicarus/iverilog/archive/v10_2.tar.gz > v10_2.tar.gz - tar -xzf v10_2.tar.gz - cd iverilog-10_2 - autoconf - ./configure --prefix=$HOME/.local - make - make install - cd .. - fi - cd $orig_pwd - fi - set +ex - - which stack iverilog shunit2 - - stack --numeric-version - - iverilog -V 2> /dev/null | head -n 1 - -install: - make - -script: - make test