verilator/.github/workflows/build.yml

78 lines
1.9 KiB
YAML
Raw Normal View History

2020-12-04 22:11:00 +00:00
# DESCRIPTION: Github actions config
# This name is key to badges in README.adoc, so we use the name build
2020-12-10 02:10:34 +00:00
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
2020-12-04 22:39:53 +00:00
2020-12-04 22:11:00 +00:00
name: build
2020-12-10 01:30:18 +00:00
on:
2020-12-04 22:11:00 +00:00
push:
pull_request:
2020-12-10 01:30:18 +00:00
workflow_dispatch:
2020-12-04 22:11:00 +00:00
schedule:
2020-12-04 22:39:53 +00:00
- cron: '0 0 * * 0' # weekly
jobs:
2020-12-10 17:33:26 +00:00
2020-12-04 22:39:53 +00:00
vlt:
strategy:
fail-fast: false
matrix:
include:
2020-12-10 17:33:26 +00:00
- { cc: clang, cxx: clang++ }
- { cc: gcc, cxx: g++ }
runs-on: ubuntu-20.04
name: Ubuntu 20.04 | ${{ matrix.cc }} | build-test
2020-12-04 22:39:53 +00:00
env:
CI_OS_NAME: linux
2020-12-11 01:22:00 +00:00
CI_RUNS_ON: ubuntu-20.04
CI_COMMIT: ${{ github.sha }}
2020-12-04 22:39:53 +00:00
CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 2Gi # 2GiB for clang and gcc, 4GiB in total
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
2020-12-04 22:39:53 +00:00
steps:
2020-12-10 17:33:26 +00:00
2020-12-04 22:39:53 +00:00
- name: Checkout
uses: actions/checkout@v2
2020-12-10 17:33:26 +00:00
2020-12-04 22:39:53 +00:00
- name: Cache
uses: actions/cache@v2
env:
2020-12-04 22:39:53 +00:00
cache-name: ccache
with:
path: ${{ github.workspace }}/.ccache
2020-12-10 17:33:26 +00:00
key: ubuntu-20.04-${{ matrix.cc }}-${{ env.cache-name }}-${{ github.sha }}
2020-12-04 22:39:53 +00:00
restore-keys: |
2020-12-10 17:33:26 +00:00
ubuntu-20.04-${{ matrix.cc }}-${{ env.cache-name }}
2020-12-04 22:39:53 +00:00
- name: Install packages for build
env:
CI_BUILD_STAGE_NAME: build
run: bash ci/ci-install.bash
2020-12-10 17:33:26 +00:00
2020-12-04 22:39:53 +00:00
- name: CCACHE maintenance
run: mkdir -p $CCACHE_DIR && bash ci/ci-ccache-maint.bash
2020-12-10 17:33:26 +00:00
2020-12-04 22:39:53 +00:00
- name: Build
env:
CI_BUILD_STAGE_NAME: build
run: bash ci/ci-script.bash
2020-12-10 17:33:26 +00:00
2020-12-04 22:39:53 +00:00
- name: Install packages for tests
env:
CI_BUILD_STAGE_NAME: test
run: bash ci/ci-install.bash
2020-12-10 17:33:26 +00:00
- name: Test
2020-12-04 22:39:53 +00:00
env:
CI_BUILD_STAGE_NAME: test
2020-12-10 17:33:26 +00:00
run: |
for item in dist-vlt-0 dist-vlt-1 vltmt-0 vltmt-1; do
echo "::group::${item}"
TESTS="${item}" bash ci/ci-script.bash
echo '::endgroup::'
done