Skip to content

Commit 6226472

Browse files
committed
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
1 parent dc42659 commit 6226472

File tree

5 files changed

+36
-26
lines changed

5 files changed

+36
-26
lines changed

.github/workflows/main.yaml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ jobs:
1616
strategy:
1717
matrix:
1818
os:
19-
- ubuntu-20.04
20-
- macOS-11
21-
- windows-2019
19+
- ubuntu-22.04
20+
- macOS-13
21+
- windows-2022
2222
steps:
23-
- uses: actions/checkout@v1
23+
- uses: actions/checkout@v4
24+
- name: Install Dependencies (macOS)
25+
if: runner.os == 'macOS'
26+
run: brew install haskell-stack
2427
- name: Build
2528
run: make
2629
- name: Prepare Artifact
2730
shell: bash
2831
run: cp LICENSE NOTICE README.md CHANGELOG.md bin
2932
- name: Upload Artifact
30-
uses: actions/upload-artifact@v1
33+
uses: actions/upload-artifact@v4
3134
with:
3235
name: ${{ runner.os }}
3336
path: bin
@@ -37,23 +40,23 @@ jobs:
3740
strategy:
3841
matrix:
3942
os:
40-
- ubuntu-20.04
41-
- macOS-11
43+
- ubuntu-22.04
44+
- macOS-13
4245
needs: build
4346
env:
4447
IVERILOG_REF: f31d0dcbc5ddcd97e1e2e6f7bc7eb0f5a547fe16
4548
steps:
46-
- uses: actions/checkout@v1
49+
- uses: actions/checkout@v4
4750
- name: Install Dependencies (macOS)
4851
if: runner.os == 'macOS'
4952
run: |
50-
brew install shunit2 bison autoconf
53+
brew install bison autoconf
5154
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
5255
- name: Install Dependencies (Linux)
5356
if: runner.os == 'Linux'
54-
run: sudo apt-get install -y shunit2 flex bison autoconf gperf
57+
run: sudo apt-get install -y flex bison autoconf gperf
5558
- name: Cache iverilog
56-
uses: actions/cache@v3
59+
uses: actions/cache@v4
5760
with:
5861
path: ~/.local
5962
key: ${{ runner.OS }}-${{ env.IVERILOG_REF }}
@@ -70,27 +73,29 @@ jobs:
7073
make install
7174
cd ..
7275
fi
76+
curl -L https://raw.githubusercontent.com/kward/shunit2/v2.1.8/shunit2 > ~/.local/bin/shunit2
77+
chmod +x ~/.local/bin/shunit2
78+
echo "$HOME/.local/bin" >> $GITHUB_PATH
7379
- name: Download Artifact
74-
uses: actions/download-artifact@v1
80+
uses: actions/download-artifact@v4
7581
with:
7682
name: ${{ runner.os }}
7783
path: bin
7884
- name: Test
7985
run: |
8086
chmod +x bin/sv2v
81-
export PATH="$PATH:$HOME/.local/bin"
8287
make test
8388
8489
release:
85-
runs-on: ubuntu-20.04
90+
runs-on: ubuntu-22.04
8691
strategy:
8792
matrix:
8893
name: [macOS, Linux, Windows]
8994
needs: build
9095
if: github.event_name == 'release'
9196
steps:
9297
- name: Download Artifact
93-
uses: actions/download-artifact@v1
98+
uses: actions/download-artifact@v4
9499
with:
95100
name: ${{ matrix.name }}
96101
path: sv2v-${{ matrix.name }}
@@ -99,7 +104,7 @@ jobs:
99104
- name: Create ZIP
100105
run: zip -r sv2v-${{ matrix.name }} ./sv2v-${{ matrix.name }}
101106
- name: Upload Release Asset
102-
uses: actions/[email protected].1
107+
uses: actions/[email protected].2
103108
env:
104109
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105110
with:

.github/workflows/notice.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ on:
1111
- NOTICE
1212
jobs:
1313
notice:
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515
steps:
16-
- uses: actions/checkout@v1
16+
- uses: actions/checkout@v4
1717
- name: Regenerate NOTICE
1818
run: ./notice.sh > NOTICE
1919
- name: Validate NOTICE

test/help/check_usage.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import subprocess
2+
3+
with open("../../README.md", "r") as file:
4+
text_readme = file.read()
5+
6+
text_help = subprocess.check_output(["../../bin/sv2v", "--help"]).decode()
7+
text_usage = "```\n" + "\n".join(text_help.split("\n")[2:-5]) + "\n```"
8+
9+
if text_usage not in text_readme:
10+
raise RuntimeError(f"'{text_usage}' not found in '{text_readme}'")

test/help/run.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@ test_help() {
55
assertTrue "getting help should succeed" $result
66
assertNotNull "stdout should not be empty" "$stdout"
77
assertNull "stderr should be empty" "$stderr"
8-
lines=`echo "$stdout" | wc -l`
9-
usage=`echo "$stdout" | tail -n +3 | head -n $(expr $lines - 5)`
10-
usage="\`\`\`
11-
$usage
12-
\`\`\`"
13-
if [[ ! $(<../../README.md) = *"$usage"* ]]; then
14-
fail "Did not find matching usage in README!"
15-
fi
8+
python3 check_usage.py
169
}
1710

1811
source ../lib/functions.sh

test/run-all.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
trap exit INT
4+
35
cd `dirname "${BASH_SOURCE[0]}"`
46

57
failures=0

0 commit comments

Comments
 (0)