CI: Add tests for open_ targets #143
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: bazel-orfs build tests | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
env: | |
DOCKER_IMAGE: openroad/flow-ubuntu22.04-builder:latest | |
jobs: | |
lint: | |
name: Lint Bazel files | |
runs-on: ubuntu-22.04 | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
steps: | |
- name: Download buildifier | |
run: | | |
wget https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-linux-amd64 -O /usr/local/bin/buildifier | |
chmod +x /usr/local/bin/buildifier | |
buildifier -version | |
- name: Checkout bazel-orfs | |
uses: actions/checkout@v4 | |
- name: Check Bazel files | |
run: | | |
buildifier -lint warn -r . | |
build-stage-target: | |
name: Build sample stage targets | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
STAGE_TARGET: | |
- "tag_array_64x184_generate_abstract" | |
- "L1MetadataArray_test_generate_abstract" | |
- "L1MetadataArray_full_generate_abstract" | |
- "L1MetadataArray_test_gds_final" | |
- "tag_array_64x184_memory" | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
swap-storage: false | |
- name: Print info | |
run: | | |
echo "USER: "$(whoami) | |
echo "PWD: "$(pwd) | |
ls -la | |
echo "HOME: "$HOME | |
docker --version | |
- name: Checkout bazel-orfs | |
uses: actions/checkout@v4 | |
- name: load docker image | |
run: | | |
bazel run --subcommands --verbose_failures --sandbox_debug orfs_env | |
- name: query target | |
run: | | |
bazel query ${{ matrix.STAGE_TARGET }} | |
bazel query ${{ matrix.STAGE_TARGET }} --output=build | |
- name: build target | |
run: | | |
bazel build --subcommands --verbose_failures --sandbox_debug ${{ matrix.STAGE_TARGET }} | |
- name: open target | |
if: matrix.STAGE_TARGET == 'L1MetadataArray_full_generate_abstract' | |
run: | | |
for stage in "synth" "floorplan" "place" "cts" "route" "final"; do | |
echo | bazel run --subcommands --verbose_failures --sandbox_debug L1MetadataArray_full_${stage}_open | |
done | |
test-make-script-target: | |
name: Execute sample _make scripts | |
runs-on: ubuntu-22.04 | |
container: | |
image: ghcr.io/antmicro/bazel-orfs@sha256:78b4c15830d75e026dc2294b280cb5ff1200f6ee7902a714dca71fd61b5b2e4e | |
volumes: | |
- /usr/share/dotnet:/usr/share/dotnet | |
- /usr/local/lib/android:/usr/local/lib/android | |
- /opt/ghc:/opt/ghc | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
steps: | |
# Workaround for https://github.com/actions/runner/issues/863 | |
- name: Override HOME env var | |
shell: bash | |
run: | | |
echo HOME=/root | sudo tee -a $GITHUB_ENV | |
- name: Increase build space | |
run: | | |
echo "Before cleanup" | |
df -H | |
rm -rf /usr/share/dotnet/* | |
rm -rf /usr/local/lib/android/* | |
rm -rf /opt/ghc/* | |
echo "After cleanup" | |
df -H | |
- name: Print info | |
run: | | |
echo "USER: "$(whoami) | |
echo "PWD: "$(pwd) | |
ls -la | |
echo "HOME: "$HOME | |
cd ~/OpenROAD-flow-scripts | |
echo "OpenROAD-flow-scripts SHA: "$(git rev-parse HEAD) | |
source ./env.sh | |
yosys --version | |
openroad -version | |
- name: Checkout bazel-orfs | |
uses: actions/checkout@v4 | |
- name: build local stage targets - tag_array_64x184 | |
env: | |
TARGET: tag_array_64x184 | |
run: .github/scripts/build_local_target.sh | |
- name: build local stage targets - lb_32x128 | |
env: | |
TARGET: lb_32x128 | |
run: .github/scripts/build_local_target.sh | |
- name: build local stage targets - L1MetadataArray_test | |
env: | |
TARGET: L1MetadataArray_test_gds | |
run: .github/scripts/build_local_target.sh | |
- name: open target | |
run: | | |
for stage in "open_synth" "floorplan" "place" "cts" "route" "final"; do | |
bazel build --subcommands --verbose_failures --sandbox_debug L1MetadataArray_test_gds_${stage}_make | |
echo | bazel-bin/L1MetadataArray_test_gds_${stage}_make open_${stage#open_} | |
done | |
test-stage-make-targets: | |
name: Run ORFS using stage targets and _make scrips | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: bash | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
STAGES: "floorplan generate_abstract" | |
TARGET: tag_array_64x184 | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
swap-storage: false | |
- name: Checkout bazel-orfs | |
uses: actions/checkout@v4 | |
- name: load docker image | |
run: | | |
bazel run --subcommands --verbose_failures --sandbox_debug orfs_env | |
- name: build synth stage targets | |
run: | | |
bazel build --subcommands --verbose_failures --sandbox_debug tag_array_64x184_synth_sdc tag_array_64x184_synth | |
- name: build make target | |
env: | |
SKIP_RUN: 1 | |
run: .github/scripts/build_local_target.sh | |
- name: set env | |
run: | | |
echo "DOCKER_ARGS=-v $(realpath ~/.cache):$(realpath ~/.cache)" >> $GITHUB_ENV | |
echo "OR_IMAGE=$DOCKER_IMAGE" >> $GITHUB_ENV | |
- name: run make target | |
run: | | |
./docker_shell.sh "export SKIP_BUILD=1 | |
export TARGET=$TARGET | |
export STAGES=\"$STAGES\" | |
cd "'$WORK_HOME | |
$WORK_HOME/.github/scripts/build_local_target.sh' |