Verilator Verification Features Tests #927
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Verilator Verification Features Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: "0 7 * * *" | |
jobs: | |
matrix: | |
name: Generate test matrix | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.make_matrix.outputs.matrix }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
clean: false | |
- name: Make build matrix | |
id: make_matrix | |
run: echo "::set-output name=matrix::$(ls verilator | jq -R -s -c 'split("\n")[:-1]')" | |
test: | |
name: Test branch ${{ matrix.VERILATOR_BRANCH }} | |
needs: matrix | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
VERILATOR_BRANCH: ${{fromJson(needs.matrix.outputs.matrix)}} | |
env: | |
CCACHE_COMPRESS: 1 | |
CCACHE_DIR: ${{ github.workspace }}/.ccache | |
CCACHE_LIMIT_MULTIPLE: 0.95 | |
CCACHE_MAXSIZE: 150M | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
clean: false | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install gcc-11 g++-11 | |
sudo apt-get -y install bison flex libfl-dev | |
sudo apt-get -y install ccache | |
sudo apt-get -y install python3-pip python3-setuptools | |
sudo apt-get -y install help2man | |
sudo pip3 install pyyaml | |
sudo pip3 install jinja2 | |
sudo pip3 install robotframework | |
- name: Cache $CCACHE_DIR | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: ${{ matrix.VERILATOR_BRANCH }} | |
- name: Build Verilator | |
working-directory: verilator/${{ matrix.VERILATOR_BRANCH }} | |
env: | |
CC: gcc-11 | |
CXX: g++-11 | |
run: | | |
git show -q | |
autoconf | |
./configure | |
make -j$(nproc) | |
- name: Generate Robot test files | |
run: ./gen-tests ${{ matrix.VERILATOR_BRANCH }} | |
- name: Run tests | |
run: | | |
for TEST_SUITE_FILE in $(ls *.robot); do | |
TEST_SUITE="${TEST_SUITE_FILE%.*}" | |
robot --report NONE --log NONE \ | |
--output $TEST_SUITE.xml \ | |
$TEST_SUITE_FILE || \ | |
[ $? -lt 252 ] # exit code >= 252 means internal Robot error | |
done | |
- name: Upload test output | |
uses: actions/upload-artifact@v3 | |
with: | |
path: "*.xml" | |
name: output-${{ matrix.VERILATOR_BRANCH }} | |
automerge: | |
name: Automerge dependabot pull requests | |
needs: [test] | |
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Trigger automerge | |
run: GITHUB_TOKEN='${{ github.token }}' gh pr merge '${{ github.event.pull_request.html_url }}' --squash | |
report: | |
name: Generate test report | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
clean: false | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install python3-pip python3-setuptools | |
sudo pip3 install robotframework | |
# install custom theme | |
sudo cp -r theme/rebot/ /usr/local/lib/python3.10/dist-packages/robot/htmldata/ | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
fetch-depth: 0 | |
clean: false | |
- name: Download test output | |
uses: actions/download-artifact@v2 | |
- name: Create report | |
run: | | |
rebot --name "Verification Features" output-*/*.xml || \ | |
[ $? -lt 252 ] # exit code >= 252 means internal Robot error | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: report | |
path: | | |
report.html | |
log.html | |
- name: Deploy to GH Pages | |
if: github.ref == 'refs/heads/main' | |
run: | | |
touch .nojekyll | |
cp report.html index.html | |
git add *.html | |
git config --local user.email "push@gha" | |
git config --local user.name "GHA" | |
git commit -am "update ${{ github.sha }}" | |
git push -u origin gh-pages |