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: ...@@ -16,18 +16,21 @@ jobs:
strategy: strategy:
matrix: matrix:
os: os:
- ubuntu-20.04 - ubuntu-22.04
- macOS-11 - macOS-13
- windows-2019 - windows-2022
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v4
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: brew install haskell-stack
- name: Build - name: Build
run: make run: make
- name: Prepare Artifact - name: Prepare Artifact
shell: bash shell: bash
run: cp LICENSE NOTICE README.md CHANGELOG.md bin run: cp LICENSE NOTICE README.md CHANGELOG.md bin
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v4
with: with:
name: ${{ runner.os }} name: ${{ runner.os }}
path: bin path: bin
...@@ -37,23 +40,23 @@ jobs: ...@@ -37,23 +40,23 @@ jobs:
strategy: strategy:
matrix: matrix:
os: os:
- ubuntu-20.04 - ubuntu-22.04
- macOS-11 - macOS-13
needs: build needs: build
env: env:
IVERILOG_REF: f31d0dcbc5ddcd97e1e2e6f7bc7eb0f5a547fe16 IVERILOG_REF: f31d0dcbc5ddcd97e1e2e6f7bc7eb0f5a547fe16
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v4
- name: Install Dependencies (macOS) - name: Install Dependencies (macOS)
if: runner.os == 'macOS' if: runner.os == 'macOS'
run: | run: |
brew install shunit2 bison autoconf brew install bison autoconf
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
- name: Install Dependencies (Linux) - name: Install Dependencies (Linux)
if: runner.os == '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 - name: Cache iverilog
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ~/.local path: ~/.local
key: ${{ runner.OS }}-${{ env.IVERILOG_REF }} key: ${{ runner.OS }}-${{ env.IVERILOG_REF }}
...@@ -70,19 +73,21 @@ jobs: ...@@ -70,19 +73,21 @@ jobs:
make install make install
cd .. cd ..
fi 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 - name: Download Artifact
uses: actions/download-artifact@v1 uses: actions/download-artifact@v4
with: with:
name: ${{ runner.os }} name: ${{ runner.os }}
path: bin path: bin
- name: Test - name: Test
run: | run: |
chmod +x bin/sv2v chmod +x bin/sv2v
export PATH="$PATH:$HOME/.local/bin"
make test make test
release: release:
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
name: [macOS, Linux, Windows] name: [macOS, Linux, Windows]
...@@ -90,7 +95,7 @@ jobs: ...@@ -90,7 +95,7 @@ jobs:
if: github.event_name == 'release' if: github.event_name == 'release'
steps: steps:
- name: Download Artifact - name: Download Artifact
uses: actions/download-artifact@v1 uses: actions/download-artifact@v4
with: with:
name: ${{ matrix.name }} name: ${{ matrix.name }}
path: sv2v-${{ matrix.name }} path: sv2v-${{ matrix.name }}
...@@ -99,7 +104,7 @@ jobs: ...@@ -99,7 +104,7 @@ jobs:
- name: Create ZIP - name: Create ZIP
run: zip -r sv2v-${{ matrix.name }} ./sv2v-${{ matrix.name }} run: zip -r sv2v-${{ matrix.name }} ./sv2v-${{ matrix.name }}
- name: Upload Release Asset - name: Upload Release Asset
uses: actions/upload-release-asset@v1.0.1 uses: actions/upload-release-asset@v1.0.2
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
......
...@@ -11,9 +11,9 @@ on: ...@@ -11,9 +11,9 @@ on:
- NOTICE - NOTICE
jobs: jobs:
notice: notice:
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v4
- name: Regenerate NOTICE - name: Regenerate NOTICE
run: ./notice.sh > NOTICE run: ./notice.sh > NOTICE
- name: Validate 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() { ...@@ -5,14 +5,7 @@ test_help() {
assertTrue "getting help should succeed" $result assertTrue "getting help should succeed" $result
assertNotNull "stdout should not be empty" "$stdout" assertNotNull "stdout should not be empty" "$stdout"
assertNull "stderr should be empty" "$stderr" assertNull "stderr should be empty" "$stderr"
lines=`echo "$stdout" | wc -l` python3 check_usage.py
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
} }
source ../lib/functions.sh source ../lib/functions.sh
......
#!/bin/bash #!/bin/bash
trap exit INT
cd `dirname "${BASH_SOURCE[0]}"` cd `dirname "${BASH_SOURCE[0]}"`
failures=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