2020-11-20 08:35:57 +08:00
|
|
|
name: Nightly integration tests
|
|
|
|
|
|
|
|
# Run on request and every day at 12 noon UTC
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: 0 12 * * *
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# Build CIRCT and run its tests using a Docker container with all the
|
|
|
|
# integration testing prerequisite installed.
|
|
|
|
build-circt:
|
|
|
|
name: Build and Test
|
2021-03-17 01:42:56 +08:00
|
|
|
runs-on: ubuntu-18.04
|
2020-11-20 08:35:57 +08:00
|
|
|
container:
|
2022-02-17 07:27:08 +08:00
|
|
|
image: ghcr.io/circt/images/circt-integration-test:v10.2
|
2021-03-03 14:21:11 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build-assert: [ON, OFF]
|
|
|
|
build-shared: [ON, OFF]
|
|
|
|
build-type: [Debug, Release]
|
|
|
|
compiler:
|
|
|
|
- cc: clang
|
|
|
|
cxx: clang++
|
|
|
|
- cc: gcc
|
|
|
|
cxx: g++
|
|
|
|
|
2020-11-20 08:35:57 +08:00
|
|
|
steps:
|
|
|
|
# Clone the CIRCT repo and its submodules. Do shallow clone to save clone
|
|
|
|
# time.
|
|
|
|
- name: Get CIRCT
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
submodules: true
|
|
|
|
|
2021-08-19 05:22:46 +08:00
|
|
|
# Setup Ccache
|
|
|
|
- name: Ccache setup
|
|
|
|
run: |
|
|
|
|
mkdir -p $GITHUB_WORKSPACE/${{ matrix.compiler.cc }}-${{ matrix.build-type }}-${{ matrix.build-shared }}-${{ matrix.build-assert }}/.ccache
|
|
|
|
ccache --set-config=cache_dir=$GITHUB_WORKSPACE/${{ matrix.compiler.cc }}-${{ matrix.build-type }}-${{ matrix.build-shared }}-${{ matrix.build-assert }}/.ccache
|
|
|
|
ccache --set-config=max_size=300M
|
|
|
|
ccache --set-config=compression=true
|
|
|
|
ccache -p
|
|
|
|
ccache -z
|
|
|
|
|
|
|
|
- name: Cache Ccache directory
|
|
|
|
uses: actions/cache@v2
|
2020-11-20 08:35:57 +08:00
|
|
|
with:
|
2021-08-19 05:22:46 +08:00
|
|
|
path: ${{ github.workspace }}/${{ matrix.compiler.cc }}-${{ matrix.build-type }}-${{ matrix.build-shared }}-${{ matrix.build-assert }}/.ccache
|
|
|
|
key: ${{ matrix.compiler.cc }}-${{ matrix.build-type }}-${{ matrix.build-shared }}-${{ matrix.build-assert }}-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.compiler.cc }}-${{ matrix.build-type }}-${{ matrix.build-shared }}-${{ matrix.build-assert }}-
|
2020-11-20 08:35:57 +08:00
|
|
|
|
|
|
|
# --------
|
2021-03-03 14:21:11 +08:00
|
|
|
# Build and test CIRCT
|
2020-11-20 08:35:57 +08:00
|
|
|
# --------
|
|
|
|
|
2021-03-03 14:21:11 +08:00
|
|
|
- name: Configure CIRCT
|
|
|
|
env:
|
|
|
|
CC: ${{ matrix.compiler.cc }}
|
|
|
|
CXX: ${{ matrix.compiler.cxx }}
|
|
|
|
BUILD_ASSERT: ${{ matrix.build-assert }}
|
|
|
|
BUILD_SHARED: ${{ matrix.build-shared }}
|
|
|
|
BUILD_TYPE: ${{ matrix.build-type }}
|
2020-11-20 08:35:57 +08:00
|
|
|
run: |
|
2021-07-29 23:49:58 +08:00
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2021-03-03 14:21:11 +08:00
|
|
|
mkdir build && cd build
|
2021-07-29 23:49:58 +08:00
|
|
|
cmake -GNinja ../llvm/llvm \
|
2021-03-03 14:21:11 +08:00
|
|
|
-DBUILD_SHARED_LIBS=$BUILD_SHARED \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
|
|
-DCMAKE_C_COMPILER=$CC \
|
|
|
|
-DCMAKE_CXX_COMPILER=$CXX \
|
2021-07-29 23:49:58 +08:00
|
|
|
-DLLVM_CCACHE_BUILD=ON \
|
|
|
|
-DLLVM_ENABLE_ASSERTIONS=$BUILD_ASSERT \
|
|
|
|
-DLLVM_ENABLE_PROJECTS=mlir \
|
|
|
|
-DLLVM_EXTERNAL_PROJECTS=circt \
|
|
|
|
-DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=.. \
|
|
|
|
-DLLVM_USE_LINKER=lld \
|
|
|
|
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
|
|
|
|
-DCIRCT_BINDINGS_PYTHON_ENABLED=ON
|
2021-03-03 14:21:11 +08:00
|
|
|
- name: Test CIRCT
|
2020-11-20 08:35:57 +08:00
|
|
|
run: |
|
2021-07-29 23:49:58 +08:00
|
|
|
ninja -C build check-circt -j$(nproc)
|
2021-03-03 14:21:11 +08:00
|
|
|
- name: Integration Test CIRCT
|
2020-11-20 08:35:57 +08:00
|
|
|
run: |
|
2021-07-29 23:49:58 +08:00
|
|
|
ninja -C build check-circt-integration -j$(nproc)
|
2021-08-19 05:22:46 +08:00
|
|
|
|
|
|
|
- name: Ccache stats
|
|
|
|
run: |
|
|
|
|
ccache -s
|