[chore] add iEDA workflow #20
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: Build project | |
on: | |
push: | |
branches: [ ng ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ ng ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: | |
- ubuntu-24.04 | |
version: | |
- 2024.07 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup dependencies | |
run: | | |
sudo apt-get update && sudo apt-get install -y yosys | |
- name: Cache bsc | |
id: cache-bsc | |
uses: actions/cache@v4 | |
with: | |
path: bsc | |
key: ${{ matrix.os }}-bsc-${{ matrix.version }}-${{ hashFiles('.github/workflows/build.yml') }} | |
- name: Download bsc | |
if: steps.cache-bsc.outputs.cache-hit != 'true' | |
run: | | |
wget -qO- https://github.com/B-Lang-org/bsc/releases/download/${{ matrix.version }}/bsc-${{ matrix.version }}-${{ matrix.os }}.tar.gz | tar xzf - | |
mv bsc-${{ matrix.version }}-${{ matrix.os }} bsc | |
echo "${{ github.workspace }}/bsc/bin" >> "$GITHUB_PATH" | |
- name: Install bsc-contrib | |
if: steps.cache-bsc.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/B-Lang-org/bsc-contrib.git | |
cd bsc-contrib | |
make -j$(nproc) PREFIX="$PWD/../bsc" | |
cd .. | |
- name: Download iEDA | |
if: steps.cache-bsc.outputs.cache-hit != 'true' | |
run: | | |
wget https://github.com/oscc-ip/artifact/releases/download/764f3f4/iEDA -O bsc/bin/iEDA | |
chmod +x bsc/bin/iEDA | |
- name: Setup Path | |
if: steps.cache-bsc.outputs.cache-hit == 'true' | |
run: | | |
echo "${{ github.workspace }}/bsc/bin" >> "$GITHUB_PATH" | |
- name: Build Project | |
run: | | |
make build | |
- name: Generate Report | |
run: | | |
make sta | |
- name: Combine Files | |
run: | | |
mv src/wrapper/* build/generated | |
cat build/generated/* > top.v | |
- name: Upload Combined File | |
uses: actions/upload-artifact@v4 | |
with: | |
name: top | |
path: top.v | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: generated | |
path: build/generated | |
- name: Upload Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: report | |
path: build/report | |
relase: | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
permissions: | |
contents: write | |
id-token: write | |
attestations: write | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: top | |
merge-multiple: true | |
- name: Publish release | |
id: publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
fail_on_unmatched_files: true | |
files: | | |
*.v | |
- name: Attest Release Files | |
id: attest | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-path: | | |
*.v |