test taking too long, tryna cut it down #286
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 | |
| # Events that trigger the workflow | |
| on: | |
| # Runs on all pushes to branches | |
| push: | |
| branches: | |
| - "**" | |
| tags-ignore: | |
| - "**" | |
| # Runs on all PRs | |
| pull_request: | |
| # Manual Dispatch | |
| workflow_dispatch: | |
| concurrency: | |
| # Behavior: | |
| # - Group all pull requests: latest push cancels previous ones | |
| # - Group all branches: | |
| # - If main/version- branches: run serially | |
| # - Else, latest push cancels previous ones | |
| group: > | |
| ${{ | |
| (github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number)) || | |
| (github.event_name == 'push' && format('branch-{0}', github.ref_name)) || | |
| '' | |
| }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' || !(startsWith(github.ref_name, 'version-') || github.ref_name == 'main' || github.ref_name == 'dev') }} | |
| jobs: | |
| pre: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Define the Matrix | |
| id: export-slots | |
| if: | |
| run: | | |
| if ${{ github.repository == 'wafer-space/gf180mcu-project-template' }}; then | |
| echo "slots=['1x1', '0p5x1', '1x0p5', '0p5x0p5']" >> $GITHUB_OUTPUT | |
| else | |
| echo "slots=['default']" >> $GITHUB_OUTPUT | |
| fi | |
| outputs: | |
| matrix: ${{ steps.export-slots.outputs.slots }} | |
| chip: | |
| runs-on: ubuntu-24.04 | |
| name: Build the Chip | |
| needs: | |
| - pre | |
| strategy: | |
| matrix: | |
| slot: ${{fromJSON(needs.pre.outputs.matrix)}} | |
| steps: | |
| - name: Set slot | |
| run: echo "SLOT=${{ matrix.slot }}" >> $GITHUB_ENV | |
| - name: Maximize build space | |
| uses: AdityaGarg8/remove-unwanted-software@v5 | |
| with: | |
| remove-dotnet: "true" | |
| remove-android: "true" | |
| remove-haskell: "true" | |
| remove-codeql: "true" | |
| remove-docker-images: "true" | |
| - uses: actions/checkout@v4 | |
| - name: Setup Nix | |
| uses: ./.github/actions/setup_nix | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| nix_cache_domain: ${{ vars.NIX_CACHE }} | |
| nix_public_key: ${{ vars.NIX_PUBLIC_KEY }} | |
| - name: Build with Nix | |
| uses: ./.github/actions/build_nix | |
| with: | |
| nix_system: x86_64-linux | |
| - name: Check Nix | |
| run: | | |
| sudo du -hs /nix/store/* | sort -h | tail -n 10 | |
| sudo tree /nix/store/*-librelane || true | |
| - name: Clone the PDK | |
| run: | | |
| make clone-pdk | |
| - name: Build firmware | |
| run: | | |
| nix shell nixpkgs#pkgsCross.riscv64-embedded.buildPackages.gcc --command \ | |
| make -C cocotb FW_VARIANT=test_top_normal firmware RISCV_PREFIX=riscv64-none-elf- | |
| - name: Run RTL simulation | |
| run: | | |
| nix develop --command make sim | |
| # cocotb also returns 0 upon failure | |
| # check the simulation results | |
| ! grep failure cocotb/sim_build/results.xml | |
| - name: Implement the Chip | |
| if: success() || failure() | |
| run: | | |
| nix develop --command make librelane | |
| nix develop --command make render-image | |
| - name: Create summary | |
| if: success() || failure() | |
| run: | | |
| echo "# Manufacturability" >> $GITHUB_STEP_SUMMARY | |
| cat librelane/runs/*/*-misc-reportmanufacturability/manufacturability.rpt >> $GITHUB_STEP_SUMMARY | |
| - name: Upload GDS | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.slot }}_gds | |
| path: final/gds/* | |
| - name: Upload image | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.slot }}_image | |
| path: img/*.png | |
| - name: Run GL simulation | |
| if: success() || failure() | |
| run: | | |
| nix develop --command make sim-gl | |
| # cocotb also returns 0 upon failure | |
| # check the simulation results | |
| ! grep failure cocotb/sim_build/results.xml |