From 8fe876463e26d1b63e36a7ebf4a2bc62366cce81 Mon Sep 17 00:00:00 2001 From: mergify[bot] Date: Wed, 7 Dec 2022 21:30:51 +0000 Subject: [CI] Update Github Actions (backport #2876) (#2877) * [ci] Update Github Actions (#2876) * Switch from deprecated setup-scala to setup-java * Switch from deprecated set-output to $GITHUB_OUTPUT * Use $GITHUB_STEP_SUMMARY for reporting (cherry picked from commit b01dd3cb613a13da4befb66dd09a8c0ba1689b68) # Conflicts: # .github/workflows/test.yml * Resolve backport conflicts Co-authored-by: Jack Koenig --- .github/workflows/test.yml | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to '.github') diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69426662..a56fa85f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,14 +16,14 @@ jobs: strategy: matrix: system: ["ubuntu-20.04"] - jvm: ["adopt@1.8"] + jvm: ["8"] scala: ["2.13.10", "2.12.17"] espresso: ["2.4"] runs-on: ${{ matrix.system }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Tabby OSS Cad Suite (from YosysHQ) uses: YosysHQ/setup-oss-cad-suite@v1 @@ -39,11 +39,11 @@ jobs: espresso || true - name: Setup Scala - uses: olafurpg/setup-scala@v10 + uses: actions/setup-java@v3 with: + distribution: 'adopt' java-version: ${{ matrix.jvm }} - - name: Cache Scala - uses: coursier/cache-action@v5 + cache: 'sbt' - name: Use Treadle for Pull Requests if: github.event_name == 'pull_request' run: echo "CHISEL3_CI_USE_TREADLE=1" >> $GITHUB_ENV @@ -57,13 +57,13 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Scala - uses: olafurpg/setup-scala@v10 + uses: actions/setup-java@v3 with: - java-version: "adopt@1.11" - - name: Cache Scala - uses: coursier/cache-action@v5 + distribution: 'adopt' + java-version: '11' + cache: 'sbt' - name: Check Formatting run: sbt scalafmtCheckAll - name: Documentation @@ -74,7 +74,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Tabby OSS Cad Suite (from YosysHQ) uses: YosysHQ/setup-oss-cad-suite@v1 with: @@ -87,11 +87,11 @@ jobs: sudo mv x86_64-linux-gnu-espresso /usr/local/bin/espresso espresso || true - name: Setup Scala - uses: olafurpg/setup-scala@v10 + uses: actions/setup-java@v3 with: - java-version: "adopt@1.11" - - name: Cache Scala - uses: coursier/cache-action@v5 + distribution: 'adopt' + java-version: '11' + cache: 'sbt' - name: Integration Tests run: sbt integrationTests/test @@ -108,7 +108,7 @@ jobs: success: ${{ steps.setoutput.outputs.success }} steps: - id: setoutput - run: echo "::set-output name=success::true" + run: echo "success=true" >> $GITHUB_OUTPUT # Related to check-tests above, this job _always_ runs (even if tests fail # and thus check-steps is skipped). This two sentinel job approach avoids an @@ -126,10 +126,10 @@ jobs: - run: | PASSED="${{ needs.check-tests.outputs.success }}" if [[ $PASSED == "true" ]]; then - echo "All tests passed!" + echo "### All tests passed! :rocket:" >> $GITHUB_STEP_SUMMARY exit 0 else - echo "One or more tests FAILED!" + echo "### One or more tests FAILED! :bangbang:" >> $GITHUB_STEP_SUMMARY exit 1 fi @@ -142,13 +142,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Scala - uses: olafurpg/setup-scala@v10 + uses: actions/setup-java@v3 with: - java-version: adopt@1.8 - - name: Cache Scala - uses: coursier/cache-action@v5 + distribution: 'adopt' + java-version: '8' + cache: 'sbt' - name: Setup GPG (for Publish) uses: olafurpg/setup-gpg@v3 - name: Publish -- cgit v1.2.3 From fb6ff513f42187c600c57fcaed162110404e8cf6 Mon Sep 17 00:00:00 2001 From: mergify[bot] Date: Tue, 20 Dec 2022 00:20:33 +0000 Subject: Switch from YosysHQ action to reusable workflow (backport #2901) (#2902) * Switch from YosysHQ action to composite action (#2901) The YosysHQ Github Action for setting up the OSS CAD Suite is very flaky in CI so instead we can just wget and untar the suite ourselves. It also seems prudent to try out composite actions to avoid duplication of installation steps. (cherry picked from commit 75aeaed9efaf1ca35573775cd21ea3b5e89e9442) # Conflicts: # .github/workflows/test.yml * Resolve backport conflicts Co-authored-by: Jack Koenig --- .github/workflows/setup-oss-cad-suite/action.yml | 14 ++++++++++++++ .github/workflows/test.yml | 14 ++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/setup-oss-cad-suite/action.yml (limited to '.github') diff --git a/.github/workflows/setup-oss-cad-suite/action.yml b/.github/workflows/setup-oss-cad-suite/action.yml new file mode 100644 index 00000000..9383d56b --- /dev/null +++ b/.github/workflows/setup-oss-cad-suite/action.yml @@ -0,0 +1,14 @@ +name: Setup OSS CAD Suite + +runs: + using: composite + steps: + - name: Install Tabby OSS Cad Suite + shell: bash + env: + VERSION: 2021-11-09 + run: | + ARTIFACT=oss-cad-suite-linux-x64-$(echo $VERSION | tr -d '-') + wget -q -O - https://github.com/YosysHQ/oss-cad-suite-build/releases/download/${VERSION}/${ARTIFACT}.tgz | tar -zx + echo "$(pwd)/oss-cad-suite/bin" >> $GITHUB_PATH + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a56fa85f..fee7019e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,12 +24,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - - name: Install Tabby OSS Cad Suite (from YosysHQ) - uses: YosysHQ/setup-oss-cad-suite@v1 - with: - osscadsuite-version: '2021-11-09' - + - name: Install Tabby OSS Cad Suite + uses: ./.github/workflows/setup-oss-cad-suite - name: Install Espresso run: | cd /tmp @@ -75,10 +71,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Install Tabby OSS Cad Suite (from YosysHQ) - uses: YosysHQ/setup-oss-cad-suite@v1 - with: - osscadsuite-version: '2021-11-09' + - name: Install Tabby OSS Cad Suite + uses: ./.github/workflows/setup-oss-cad-suite - name: Install Espresso run: | cd /tmp -- cgit v1.2.3 From b913a75beb10adf4421d22ae386cbb29d144b774 Mon Sep 17 00:00:00 2001 From: mergify[bot] Date: Tue, 20 Dec 2022 15:53:29 +0000 Subject: DRY out CI (backport #2903) (#2905) * DRY out CI (#2903) * Minor tweaks to setup-oss-cad-suite * Switch espresso installation to composite action * Switch circt installation to composite action (cherry picked from commit dbd5f48a884a236f95c8476d56e28ca911b64a8d) # Conflicts: # .github/workflows/test.yml * resolve backport conflicts Co-authored-by: Jack Koenig --- .github/workflows/install-espresso/action.yml | 25 ++++++++++++++++++++++++ .github/workflows/setup-oss-cad-suite/action.yml | 24 ++++++++++++++++++----- .github/workflows/test.yml | 17 ++++------------ 3 files changed, 48 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/install-espresso/action.yml (limited to '.github') diff --git a/.github/workflows/install-espresso/action.yml b/.github/workflows/install-espresso/action.yml new file mode 100644 index 00000000..fb1d655a --- /dev/null +++ b/.github/workflows/install-espresso/action.yml @@ -0,0 +1,25 @@ +name: Install Espresso + +inputs: + version: + description: 'version to install' + required: false + default: '2.4' + +runs: + using: composite + steps: + - id: cache-espresso + uses: actions/cache@v3 + with: + path: /usr/local/bin/espresso + key: espresso-${{ runner.os }}-${{ inputs.version }} + + - shell: bash + if: steps.cache-espresso.outputs.cache-hit != 'true' + run: | + cd /tmp + wget -q https://github.com/chipsalliance/espresso/releases/download/v${{ inputs.version }}/x86_64-linux-gnu-espresso + chmod +x x86_64-linux-gnu-espresso + sudo mv x86_64-linux-gnu-espresso /usr/local/bin/espresso + espresso || true diff --git a/.github/workflows/setup-oss-cad-suite/action.yml b/.github/workflows/setup-oss-cad-suite/action.yml index 9383d56b..63d70e92 100644 --- a/.github/workflows/setup-oss-cad-suite/action.yml +++ b/.github/workflows/setup-oss-cad-suite/action.yml @@ -1,14 +1,28 @@ name: Setup OSS CAD Suite +inputs: + version: + description: 'version to install' + required: false + default: '2021-11-09' + runs: using: composite steps: - - name: Install Tabby OSS Cad Suite - shell: bash - env: - VERSION: 2021-11-09 + - id: cache-oss-cad-suite + uses: actions/cache@v3 + with: + path: oss-cad-suite + key: oss-cad-suite-${{ runner.os }}-${{ inputs.version }} + + - shell: bash + if: steps.cache-oss-cad-suite.outputs.cache-hit != 'true' run: | + VERSION=${{ inputs.version }} ARTIFACT=oss-cad-suite-linux-x64-$(echo $VERSION | tr -d '-') wget -q -O - https://github.com/YosysHQ/oss-cad-suite-build/releases/download/${VERSION}/${ARTIFACT}.tgz | tar -zx - echo "$(pwd)/oss-cad-suite/bin" >> $GITHUB_PATH + + # Add the CAD Suite to the PATH + - shell: bash + run: echo "$(pwd)/oss-cad-suite/bin" >> $GITHUB_PATH diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fee7019e..dd129812 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,13 +27,9 @@ jobs: - name: Install Tabby OSS Cad Suite uses: ./.github/workflows/setup-oss-cad-suite - name: Install Espresso - run: | - cd /tmp - wget https://github.com/chipsalliance/espresso/releases/download/v${{ matrix.espresso }}/x86_64-linux-gnu-espresso - chmod +x x86_64-linux-gnu-espresso - sudo mv x86_64-linux-gnu-espresso /usr/local/bin/espresso - espresso || true - + uses: ./.github/workflows/install-espresso + with: + version: ${{ matrix.espresso }} - name: Setup Scala uses: actions/setup-java@v3 with: @@ -74,12 +70,7 @@ jobs: - name: Install Tabby OSS Cad Suite uses: ./.github/workflows/setup-oss-cad-suite - name: Install Espresso - run: | - cd /tmp - wget https://github.com/chipsalliance/espresso/releases/download/v2.4/x86_64-linux-gnu-espresso - chmod +x x86_64-linux-gnu-espresso - sudo mv x86_64-linux-gnu-espresso /usr/local/bin/espresso - espresso || true + uses: ./.github/workflows/install-espresso - name: Setup Scala uses: actions/setup-java@v3 with: -- cgit v1.2.3