Commit 7a7482c9 by Zachary Snow

fix GitHub Actions setup

- refresh GitHub Actions versions
- manually install shUnit2 v2.1.8
- more portable usage check
- run-all.sh exits on ctrl-c
parent d856c59a
......@@ -16,18 +16,21 @@ jobs:
strategy:
matrix:
os:
- ubuntu-20.04
- macOS-11
- windows-2019
- ubuntu-22.04
- macOS-13
- windows-2022
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: brew install haskell-stack
- name: Build
run: make
- name: Prepare Artifact
shell: bash
run: cp LICENSE NOTICE README.md CHANGELOG.md bin
- name: Upload Artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}
path: bin
......@@ -37,23 +40,23 @@ jobs:
strategy:
matrix:
os:
- ubuntu-20.04
- macOS-11
- ubuntu-22.04
- macOS-13
needs: build
env:
IVERILOG_REF: f31d0dcbc5ddcd97e1e2e6f7bc7eb0f5a547fe16
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install shunit2 bison autoconf
brew install bison autoconf
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install -y shunit2 flex bison autoconf gperf
run: sudo apt-get install -y flex bison autoconf gperf
- name: Cache iverilog
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.local
key: ${{ runner.OS }}-${{ env.IVERILOG_REF }}
......@@ -70,19 +73,21 @@ jobs:
make install
cd ..
fi
curl -L https://raw.githubusercontent.com/kward/shunit2/v2.1.8/shunit2 > ~/.local/bin/shunit2
chmod +x ~/.local/bin/shunit2
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Download Artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: ${{ runner.os }}
path: bin
- name: Test
run: |
chmod +x bin/sv2v
export PATH="$PATH:$HOME/.local/bin"
make test
release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
name: [macOS, Linux, Windows]
......@@ -90,7 +95,7 @@ jobs:
if: github.event_name == 'release'
steps:
- name: Download Artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: ${{ matrix.name }}
path: sv2v-${{ matrix.name }}
......@@ -99,7 +104,7 @@ jobs:
- name: Create ZIP
run: zip -r sv2v-${{ matrix.name }} ./sv2v-${{ matrix.name }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1.0.1
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
......
......@@ -11,9 +11,9 @@ on:
- NOTICE
jobs:
notice:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Regenerate NOTICE
run: ./notice.sh > NOTICE
- name: Validate NOTICE
......
import subprocess
with open("../../README.md", "r") as file:
text_readme = file.read()
text_help = subprocess.check_output(["../../bin/sv2v", "--help"]).decode()
text_usage = "```\n" + "\n".join(text_help.split("\n")[2:-5]) + "\n```"
if text_usage not in text_readme:
raise RuntimeError(f"'{text_usage}' not found in '{text_readme}'")
......@@ -5,14 +5,7 @@ test_help() {
assertTrue "getting help should succeed" $result
assertNotNull "stdout should not be empty" "$stdout"
assertNull "stderr should be empty" "$stderr"
lines=`echo "$stdout" | wc -l`
usage=`echo "$stdout" | tail -n +3 | head -n $(expr $lines - 5)`
usage="\`\`\`
$usage
\`\`\`"
if [[ ! $(<../../README.md) = *"$usage"* ]]; then
fail "Did not find matching usage in README!"
fi
python3 check_usage.py
}
source ../lib/functions.sh
......
#!/bin/bash
trap exit INT
cd `dirname "${BASH_SOURCE[0]}"`
failures=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment