diff --git a/.github/actions/oss-cad-suite/action.yml b/.github/actions/oss-cad-suite/action.yml new file mode 100644 index 0000000..439fa81 --- /dev/null +++ b/.github/actions/oss-cad-suite/action.yml @@ -0,0 +1,30 @@ +name: OSS CAD Suite +description: Install the pinned OSS CAD Suite and put its binaries on the path + +inputs: + version: + description: Release tag of the OSS CAD Suite build + required: true + +runs: + using: composite + steps: + - name: Restore the CAD suite + id: cache + uses: actions/cache@v6 + with: + path: ${{ runner.temp }}/oss-cad-suite + key: oss-cad-suite-linux-x64-${{ inputs.version }} + - name: Download the CAD suite + if: steps.cache.outputs.cache-hit != 'true' + shell: bash + env: + TAG: ${{ inputs.version }} + run: | + mkdir -p "$RUNNER_TEMP/oss-cad-suite" + curl -fsSL "https://github.com/YosysHQ/oss-cad-suite-build/releases/download/$TAG/oss-cad-suite-linux-x64-${TAG//-/}.tgz" -o "$RUNNER_TEMP/cad.tgz" + tar -xzf "$RUNNER_TEMP/cad.tgz" -C "$RUNNER_TEMP/oss-cad-suite" --strip-components=1 + rm "$RUNNER_TEMP/cad.tgz" + - name: Put the CAD suite on the path + shell: bash + run: echo "$RUNNER_TEMP/oss-cad-suite/bin" >> "$GITHUB_PATH" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f309043..dbed88b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,17 +5,14 @@ env: on: push: - branches: [main] - pull_request: jobs: testbenches: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: YosysHQ/setup-oss-cad-suite@v4 + - uses: ./.github/actions/oss-cad-suite with: - github-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ env.OSS_CAD_SUITE }} - name: synchronizer run: make MOD=synchronizer @@ -51,9 +48,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: YosysHQ/setup-oss-cad-suite@v4 + - uses: ./.github/actions/oss-cad-suite with: - github-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ env.OSS_CAD_SUITE }} - name: uart_rx formal run: make formal MOD=uart_rx