ci: Fix wrong conda env name #272
This file contains hidden or 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: ci | |
| on: | |
| push: | |
| pull_request: | |
| defaults: | |
| run: | |
| # for conda | |
| shell: bash -leo pipefail {0} | |
| env: | |
| CHIPYARD_RELPATH: chipyard-work | |
| CHIPYARD_RUN_ROOT: "/scratch/buildbot/radiance-ci-runs/${{ github.run_id }}-${{ github.run_attempt }}" | |
| CHIPYARD_DIR: "/scratch/buildbot/radiance-ci-runs/${{ github.run_id }}-${{ github.run_attempt }}/chipyard" | |
| # flip to force-reset cache | |
| CACHE_NUMBER: 0 | |
| JAVA_HEAP_SIZE: "64G" | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: as4 | |
| env: | |
| # fix broken IPv6 | |
| RUSTUP_USE_CURL: "1" | |
| CURL_IPRESOLVE: "4" | |
| CARGO_REGISTRIES_CRATES_IO_PROTOCOL: "sparse" | |
| CARGO_NET_RETRY: "10" | |
| CARGO_HTTP_TIMEOUT: "60" | |
| steps: | |
| - name: Setup system | |
| run: | | |
| set -x | |
| cat /proc/cpuinfo | tail -n20 | |
| vmstat -SM | |
| df -h | |
| [ -d "${{ github.workspace }}" ] && rm -rf "${{ github.workspace }}"/* | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Checkout Chipyard | |
| id: checkout-chipyard | |
| run: | | |
| mkdir -p "${CHIPYARD_RUN_ROOT}" | |
| git clone --depth 1 --branch graphics "https://github.com/ucb-bar/chipyard.git" "${CHIPYARD_DIR}" | |
| cd "${CHIPYARD_DIR}" | |
| CHIPYARD_HASH="$(git rev-parse HEAD)" | |
| echo "CHIPYARD_HASH=${CHIPYARD_HASH}" >> "${GITHUB_ENV}" | |
| echo "chipyard_hash=${CHIPYARD_HASH}" >> "${GITHUB_OUTPUT}" | |
| # for caching | |
| ln -sf "${CHIPYARD_DIR}" "${GITHUB_WORKSPACE}/${CHIPYARD_RELPATH}" | |
| - name: Install conda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| auto-update-conda: true | |
| auto-activate-base: true | |
| activate-environment: "" | |
| - name: Configure conda env | |
| id: conda-env | |
| run: | | |
| CONDA_BASE="$(conda info --base)" | |
| CONDA_ENV_NAME="chipyard-${CHIPYARD_HASH}" | |
| CONDA_ENV_DIR="${CONDA_BASE}/envs/${CONDA_ENV_NAME}" | |
| echo "CONDA_ENV_NAME=${CONDA_ENV_NAME}" >> "${GITHUB_ENV}" | |
| echo "CONDA_ENV_DIR=${CONDA_ENV_DIR}" >> "${GITHUB_ENV}" | |
| echo "conda_env_name=${CONDA_ENV_NAME}" >> "${GITHUB_OUTPUT}" | |
| echo "conda_env_dir=${CONDA_ENV_DIR}" >> "${GITHUB_OUTPUT}" | |
| - name: Setup rust | |
| run: | | |
| echo "CARGO_HOME=$HOME/.cargo" >> "$GITHUB_ENV" | |
| echo "RUSTUP_HOME=$HOME/.rustup" >> "$GITHUB_ENV" | |
| echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" | |
| - name: Check rust | |
| run: | | |
| command -v rustc | |
| command -v cargo | |
| rustup --version | |
| rustc --version | |
| cargo --version | |
| - name: Cache conda-env | |
| id: cache-conda-env | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ${{ steps.conda-env.outputs.conda_env_dir }} | |
| key: chipyard-${{ steps.checkout-chipyard.outputs.chipyard_hash }}-${{ runner.os }}-${{ runner.arch }}-${{ env.CACHE_NUMBER }} | |
| - name: Setup Chipyard | |
| run: | | |
| .github/scripts/setup-chipyard.sh "${{ steps.cache-conda-env.outputs.cache-hit }}" | |
| - name: Setup Radiance | |
| # move radiance to under chipyard/generators | |
| run: | | |
| set -eux | |
| rm -rf "${CHIPYARD_DIR}/generators/radiance" | |
| rsync -a --exclude "/${CHIPYARD_RELPATH}/" \ | |
| "${GITHUB_WORKSPACE}/" "${CHIPYARD_DIR}/generators/radiance/" | |
| ls -al "${CHIPYARD_DIR}/generators/radiance" | |
| # warm up cargo as fetching index.crates.io likes to fail intermittently | |
| - name: Cargo fetch | |
| run: | | |
| cd "${CHIPYARD_DIR}/generators/radiance/cyclotron" | |
| cargo fetch | |
| - name: Cache Scala build files | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ${{ env.CHIPYARD_DIR }}/generators/**/target/** | |
| ${{ env.CHIPYARD_RELPATH }}/.ivy2/cache | |
| ${{ env.CHIPYARD_RELPATH }}/.sbt | |
| ~/.cache/coursier | |
| key: scala-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}-${{ env.CACHE_NUMBER }} | |
| restore-keys: | | |
| scala-${{ runner.os }}-${{ runner.arch }}- | |
| - name: Build Radiance sim binary | |
| run: | | |
| cd "${CHIPYARD_DIR}" | |
| source env.sh | |
| source /ecad/tools/vlsi.bashrc | |
| cd sims/vcs | |
| make debug SUB_PROJECT=muon CONFIG=MuonBackendTestConfig | |
| make debug SUB_PROJECT=muon CONFIG=MuonCoreTestConfig | |
| make debug CONFIG=RadianceCyclotronConfig | |
| make debug CONFIG=RadianceTapeoutSimConfig | |
| run-unit-tests: | |
| name: Run Unit-tests | |
| runs-on: as4 | |
| needs: build | |
| steps: | |
| - name: Run ChiselTest unit-tests | |
| run: | | |
| cd "${CHIPYARD_DIR}" | |
| source env.sh | |
| source /ecad/tools/vlsi.bashrc | |
| sbt "project radiance; \ | |
| testOnly radiance.muon.ALUPipeTest; \ | |
| testOnly radiance.muon.FPPipeTest; \ | |
| testOnly radiance.muon.MulDivPipeTest; \ | |
| testOnly radiance.muon.SequencerTest; \ | |
| testOnly radiance.muon.ScoreboardTest" | |
| run-soc-binary-tests: | |
| name: Run SoC binary tests | |
| runs-on: as4 | |
| needs: build | |
| steps: | |
| - name: Run binary tests on SoC config | |
| run: | | |
| cd "${CHIPYARD_DIR}" | |
| source env.sh | |
| source /ecad/tools/vlsi.bashrc | |
| cd generators/radiance | |
| python3 test/run_binary_tests.py -j "$(nproc)" \ | |
| --json-out test/binary-test-logs/soc/results.json | |
| - name: Render binary test report | |
| if: always() | |
| run: | | |
| cd "${CHIPYARD_DIR}/generators/radiance" | |
| python3 test/render_binary_test_report.py \ | |
| test/binary-test-logs/soc/results.json \ | |
| --github-step-summary | |
| run-core-binary-tests: | |
| name: Run Core-standalone binary tests | |
| runs-on: as4 | |
| needs: build | |
| steps: | |
| - name: Run binary tests on core-as-top config | |
| run: | | |
| cd "${CHIPYARD_DIR}" | |
| source env.sh | |
| source /ecad/tools/vlsi.bashrc | |
| cd generators/radiance | |
| python3 test/run_binary_tests.py -j "$(nproc)" -c core \ | |
| --json-out test/binary-test-logs/core/results.json | |
| - name: Render binary test report | |
| if: always() | |
| run: | | |
| cd "${CHIPYARD_DIR}/generators/radiance" | |
| python3 test/render_binary_test_report.py \ | |
| test/binary-test-logs/core/results.json \ | |
| --github-step-summary | |
| run-cosim-binary-tests: | |
| name: Run Cyclotron-as-a-Tile Co-sim binary tests | |
| runs-on: as4 | |
| needs: build | |
| steps: | |
| - name: Run binary tests on backend co-sim config | |
| run: | | |
| cd "${CHIPYARD_DIR}" | |
| source env.sh | |
| source /ecad/tools/vlsi.bashrc | |
| cd generators/radiance | |
| python3 test/run_binary_tests.py -j "$(nproc)" -c cosim \ | |
| --json-out test/binary-test-logs/cosim/results.json | |
| - name: Render binary test report | |
| if: always() | |
| run: | | |
| cd "${CHIPYARD_DIR}/generators/radiance" | |
| python3 test/render_binary_test_report.py \ | |
| test/binary-test-logs/cosim/results.json \ | |
| --github-step-summary | |
| # run-backend-cosim-binary-tests: | |
| # name: Run Backend Co-sim binary tests | |
| # runs-on: as4 | |
| # needs: build | |
| # steps: | |
| # - name: Run binary tests on backend co-sim config | |
| # run: | | |
| # cd "${CHIPYARD_DIR}" | |
| # source env.sh | |
| # source /ecad/tools/vlsi.bashrc | |
| # cd generators/radiance | |
| # python3 test/run_binary_tests.py -j "$(nproc)" -c backend \ | |
| # --json-out test/binary-test-logs/backend/results.json | |
| # - name: Render binary test report | |
| # if: always() | |
| # run: | | |
| # cd "${CHIPYARD_DIR}/generators/radiance" | |
| # python3 test/render_binary_test_report.py \ | |
| # test/binary-test-logs/backend/results.json \ | |
| # --github-step-summary | |
| clean: | |
| name: Clean | |
| runs-on: as4 | |
| needs: [build, run-unit-tests, run-soc-binary-tests, run-core-binary-tests, run-cosim-binary-tests] | |
| if: always() | |
| steps: | |
| - name: Cleanup workspace, chipyard and conda | |
| run: | | |
| [ -d "${{ github.workspace }}" ] && rm -rf "${{ github.workspace }}" | |
| [ -d "${CHIPYARD_RUN_ROOT}" ] && rm -rf "${CHIPYARD_RUN_ROOT}" |