Skip to content

Builds

Builds #428

Workflow file for this run

name: Builds
permissions:
contents: read
actions: write
on:
push:
branches: [ "main" ]
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout submodules' submodules
run: |
# Checkout IREE's submodule but not the submodules of IREE's submodules!
# This saves us cloning LLVM twice.
# If we were lazy we could just clone recursively.
cd ${{github.workspace}}/iree && git submodule update --init --force --depth=1
cd ${{github.workspace}}/snitch_cluster && git submodule update --init --force --depth=1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pip'
cache-dependency-path: |
./runtime/**/requirements.txt
./codegen/**/requirements.txt
./requirements.txt
./.git/modules/xdsl/HEAD
- name: Install minimum required cmake and ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.21.0"
- name: Install CCache
uses: Chocobo1/setup-ccache-action@v1
with:
ccache_options: |
max_size=1G
compiler_check=none
- name: Install Native Compilers
run: |
sudo apt-get update
sudo apt-get install lld clang
- name: Install Quidditch Toolchain
run: |
mkdir ./toolchain
docker run --rm ghcr.io/opencompl/quidditch/toolchain:main tar -cC /opt/quidditch-toolchain . \
| tar -xC ./toolchain
- name: Configure Megabuild
run: |
cmake -G Ninja -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DQUIDDITCH_TOOLCHAIN_FILE=${{github.workspace}}/toolchain/ToolchainFile.cmake \
-DOVERRIDE_VENV=ON \
-S ${{github.workspace}}
- name: Build and Test precommit
if: ${{ github.event_name == 'pull_request' }}
run: cmake --build ${{github.workspace}}/build --target test
- uses: jlumbroso/free-disk-space@v1.3.1
if: ${{ github.event_name != 'pull_request' }}
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
- name: Build and Test nightly
if: ${{ github.event_name != 'pull_request' }}
run: |
cmake --build ${{github.workspace}}/build --target runtime
# Clean disk space ahead of runs.
rm -rf ${{github.workspace}}/build/*.o ${{github.workspace}}/build/*.a
cd ${{github.workspace}}/build/runtime
# NsNet2 traces ought to fit here.
ctest -R "NsNet2$" --extra-verbose -j$(nproc)
- name: Upload traces
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4.3.3
with:
name: 'Perfetto traces'
# Maximum retention possible.
retention-days: 90
if-no-files-found: error
path: ${{github.workspace}}/build/runtime/tests/NsNet2.test/events.json