verilator/.github/workflows/coverage.yml

99 lines
2.1 KiB
YAML
Raw Normal View History

2020-12-08 02:57:10 +00:00
# DESCRIPTION: Github actions config
2020-12-10 02:10:34 +00:00
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
2020-12-08 02:57:10 +00:00
name: coverage
2020-12-10 01:30:18 +00:00
on:
2020-12-08 02:57:10 +00:00
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # weekly
2020-12-10 01:30:18 +00:00
env:
CI_OS_NAME: linux
CI_COMMIT: ${{ github.sha }}
CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 2Gi # 2GiB for clang and gcc, 4GiB in total
COVERAGE: 1
2020-12-08 02:57:10 +00:00
jobs:
2020-12-10 01:30:18 +00:00
Build:
2020-12-10 01:38:41 +00:00
runs-on: ubuntu-20.04
env:
CI_BUILD_STAGE_NAME: build
2020-12-10 01:30:18 +00:00
steps:
2020-12-10 01:37:11 +00:00
- uses: actions/checkout@v2
2020-12-10 02:30:31 +00:00
- uses: actions/cache@v2
env:
cache-name: ccache
with:
path: ${{ github.workspace }}/.ccache
key: coverage-${{ env.cache-name }}-${{ github.sha }}
restore-keys: coverage-${{ env.cache-name }}
- name: Install dependencies for build
env:
CI_BUILD_STAGE_NAME: build
run: ./ci/ci-install.bash
- name: Build Verilator
run: |
./ci/ci-script.bash
2020-12-10 01:30:18 +00:00
mkdir tarball/
cp -vr bin tarball/
cp -vr src/obj*/*.gcno tarball/
tar cvzf verilator-${CI_COMMIT}.tgz -C ./tarball .
- uses: actions/upload-artifact@v2
with:
path: verilator-${{ env.CI_COMMIT }}.tgz
2020-12-10 01:30:18 +00:00
Test:
needs: Build
strategy:
fail-fast: false
matrix:
test:
- vlt-
- vltmt-
num:
- 0
- 1
- 2
- 3
include:
- { test: dist, num: '' }
name: test-${{ matrix.test }}${{ matrix.num }}
2020-12-10 01:38:41 +00:00
runs-on: ubuntu-20.04
env:
CI_BUILD_STAGE_NAME: test
2020-12-10 01:30:18 +00:00
steps:
2020-12-10 01:37:11 +00:00
- uses: actions/checkout@v2
2020-12-10 02:30:31 +00:00
- uses: actions/cache@v2
env:
cache-name: ccache
with:
path: ${{ github.workspace }}/.ccache
key: coverage-${{ env.cache-name }}-${{ github.sha }}
restore-keys: coverage-${{ env.cache-name }}
- uses: actions/download-artifact@v2
- name: Install Verilator and test dependencies
run: |
tar xvzf artifact/verilator-${CI_COMMIT}.tgz
./ci/ci-install.bash
- name: Test
env:
TESTS: coverage-${{ matrix.test }}${{ matrix.num }}
run: ./ci/ci-script.bash