Build OpenSTA #397
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: Build OpenSTA | |
| on: | |
| push: | |
| paths: | |
| - ".github/workflows/build-opensta.yml" | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| check: | |
| outputs: | |
| sha: ${{ steps.sha.outputs.sha }} | |
| release-exists: ${{ steps.release.outputs.release-exists }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Gather SHA | |
| id: sha | |
| run: | | |
| commit_sha=$(curl -s "https://api.github.com/repos/parallaxsw/OpenSTA/commits" | jq -r '.[0].sha') | |
| if [ -z "$commit_sha" ]; then | |
| exit 1 | |
| fi | |
| echo "sha=$(echo $commit_sha | cut -c1-7)" >> "$GITHUB_OUTPUT" | |
| - name: Check if release exists | |
| id: release | |
| run: | | |
| response=$(curl -s -o /dev/null -w "%{http_code}" "https://api.github.com/repos/oscc-ip/artifact/releases/tags/${{ steps.sha.outputs.sha }}") | |
| if [ "$response" -eq 200 ]; then | |
| echo "release-exists=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "release-exists=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: check | |
| if: needs.check.outputs.release-exists == 'false' | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: parallaxsw/OpenSTA | |
| submodules: true | |
| - name: Set up dependencies | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y flex libfl-dev bison tcl-dev tcl-tclreadline libeigen3-dev ninja-build | |
| - name: Set up cudd-3.0.0 | |
| run: | | |
| wget https://github.com/oscc-ip/artifact/releases/download/cudd-3.0.0/build.tar.gz | |
| mkdir -p cudd | |
| tar -zxvf build.tar.gz -Ccudd | |
| - name: Build OpenSTA | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake .. -G Ninja -DCUDD_DIR=$(pwd)/../cudd -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DCMAKE_BUILD_TYPE=Release | |
| cmake --build . --target all -- -j $(nproc) | |
| cmake --install . | |
| tar -zcvf build.tar.gz -Cinstall . | |
| cd .. | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| path: | | |
| build/install/* | |
| - name: Publish Release | |
| id: publish | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| fail_on_unmatched_files: true | |
| name: OpenSTA-${{ needs.check.outputs.sha }} | |
| tag_name: ${{ needs.check.outputs.sha }} | |
| make_latest: true | |
| files: | | |
| build/build.tar.gz | |
| build/install/bin/* | |
| body: | | |
| OpenSTA release | |
| - name: Attest Release Files | |
| id: attest | |
| uses: actions/attest-build-provenance@v4 | |
| with: | |
| subject-path: | | |
| build/build.tar.gz | |
| build/install/bin/* |