Skip to content

Commit

Permalink
CI: Update workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Illia Vysochyn <[email protected]>
  • Loading branch information
ivysochyn committed Jul 31, 2024
1 parent c4445b1 commit a48f4ac
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 38 deletions.
27 changes: 17 additions & 10 deletions .github/scripts/build_local_target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,32 @@
set -e

target_name=${TARGET:-"tag_array_64x184"}
flow=${FLOW:-"local_make"}
if [[ -z "$STAGES" ]]; then
STAGES=("synth_sdc" "synth" "floorplan" "place" "cts" "generate_abstract")
STAGES=("synth" "floorplan" "place" "cts")
else
eval "STAGES=($STAGES)"
fi

echo "Build tag_array_64x184 macro"
for stage in ${STAGES[@]}
echo "Build ${target_name} macro"
for stage in "${STAGES[@]}"
do
if [[ -z $SKIP_BUILD ]] ; then
echo "query make script target"
bazel query ${target_name}_${stage}_scripts
bazel query ${target_name}_${stage}_scripts --output=build
echo "build make script"
bazel build --subcommands --verbose_failures --sandbox_debug ${target_name}_${stage}_scripts
echo "query dependency target"
bazel query "${target_name}_${stage}_deps"
bazel query "${target_name}_${stage}_deps" --output=build
echo "build dependency"
bazel run --subcommands --verbose_failures --sandbox_debug "${target_name}_${stage}_deps" -- "$(pwd)/build"
fi
if [[ -z $SKIP_RUN ]] ; then
echo "run make script"
./bazel-bin/${target_name}_${stage}_${flow} "bazel-"${stage}
build/make "${stage}"
fi
done

if [[ -z $SKIP_BUILD && -z $SKIP_ABSTRACT ]]; then
echo "query abstract target"
bazel query "${target_name}_generate_abstract"
bazel query "${target_name}_generate_abstract" --output=build
echo "build abstract"
bazel build --subcommands --verbose_failures --sandbox_debug "${target_name}_generate_abstract"
fi
55 changes: 27 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
fail-fast: false
matrix:
STAGE_TARGET:
- tag_array_64x184_generate_abstract_make
- L1MetadataArray_test_generate_abstract_make
- regfile_128x65_floorplan_make
- lb_32x128_generate_abstract_make
- data_2048x8_generate_abstract_make
- tag_array_64x184_generate_abstract
- L1MetadataArray_test_generate_abstract
- lb_32x128_generate_abstract
- data_2048x8_generate_abstract
- subpackage:tag_array_64x184_generate_abstract
- regfile_128x65_floorplan
env:
DEBIAN_FRONTEND: "noninteractive"
steps:
Expand All @@ -55,19 +55,22 @@ jobs:
docker --version
- name: Checkout bazel-orfs
uses: actions/checkout@v4
- name: load docker image
run: |
bazel run --subcommands --verbose_failures --sandbox_debug @bazel-orfs//:orfs_env
- name: query target
- name: Query target
run: |
bazel query ${{ matrix.STAGE_TARGET }}
bazel query ${{ matrix.STAGE_TARGET }} --output=build
- name: build target
- name: Build abstract target
if: matrix.STAGE_TARGET != 'regfile_128x65_floorplan'
run: |
bazel build --subcommands --verbose_failures --sandbox_debug ${{ matrix.STAGE_TARGET }}
- name: Build floorplan target
if: matrix.STAGE_TARGET == 'regfile_128x65_floorplan'
run: |
bazel run --subcommands --verbose_failures --sandbox_debug ${{ matrix.STAGE_TARGET }} -- `pwd`/build
test-make-scripts-target-local:
name: Local flow - test _scripts tartgets
name: Local flow - test _scripts targets
runs-on: ubuntu-22.04
container:
image: ghcr.io/antmicro/openroad-flow-scripts/ubuntu22.04@sha256:ef18800147f1b09fd00366c32b2266da4944d59d588680ed05d2685fbae2531a
Expand Down Expand Up @@ -97,23 +100,23 @@ jobs:
chmod +x /usr/local/bin/bazel
- name: Checkout megaboom
uses: actions/checkout@v4
- name: build local stage targets - tag_array_64x184
- 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 - L1MetadataArray_test
- name: Build local stage targets - L1MetadataArray_test
env:
TARGET: L1MetadataArray_test
STAGES: synth_sdc synth floorplan place generate_abstract
STAGES: synth floorplan place
run: .github/scripts/build_local_target.sh
- name: open targets
- name: Open targets
run: |
for stage in "synth" "floorplan" "place"; do
echo | bazel-bin/L1MetadataArray_test_${stage}_local_make open_${stage}
for stage in "floorplan" "place"; do
echo | build/make open_${stage}
done
test-make-scripts-target-docker:
name: Docker flow - test _scripts tartgets
name: Docker flow - test _scripts targets
runs-on: ubuntu-22.04
defaults:
run:
Expand All @@ -122,7 +125,6 @@ jobs:
fail-fast: false
env:
DEBIAN_FRONTEND: "noninteractive"
FLOW: docker
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
Expand All @@ -137,21 +139,18 @@ jobs:
docker --version
- name: Checkout bazel-orfs
uses: actions/checkout@v4
- name: load docker image
run: |
bazel run --subcommands --verbose_failures --sandbox_debug @bazel-orfs//:orfs_env
- name: build local stage targets - tag_array_64x184
- 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 - L1MetadataArray_test
- name: Build local stage targets - L1MetadataArray_test
env:
TARGET: L1MetadataArray_test
STAGES: synth_sdc synth floorplan place generate_abstract
STAGES: synth floorplan place
run: .github/scripts/build_local_target.sh
- name: open target
- name: Open target
if: matrix.STAGE_TARGET == 'L1MetadataArray_test_generate_abstract'
run: |
for stage in "synth" "floorplan" "place"; do
echo | bazel-bin/L1MetadataArray_test_${stage}_docker open_${stage}
for stage in "floorplan" "place"; do
echo | build/make open_${stage}
done

0 comments on commit a48f4ac

Please sign in to comment.