From 00396ab847725d083725c349a83836bae4f72333 Mon Sep 17 00:00:00 2001 From: miaochenlu Date: Wed, 8 Jan 2025 14:11:14 +0800 Subject: [PATCH] ci: add cache_test ci --- .github/workflows/cache_test.yml | 38 ++++++++++++++++ .github/workflows/template-cleanup.yml | 62 -------------------------- .github/workflows/test.yml | 59 ------------------------ 3 files changed, 38 insertions(+), 121 deletions(-) create mode 100644 .github/workflows/cache_test.yml delete mode 100644 .github/workflows/template-cleanup.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/cache_test.yml b/.github/workflows/cache_test.yml new file mode 100644 index 000000000..83fe75a45 --- /dev/null +++ b/.github/workflows/cache_test.yml @@ -0,0 +1,38 @@ +name: GPC DCache Test + +on: + push: + tags: ['*'] + branches: ['gpc_cache*'] + pull_request: + workflow_dispatch: + +jobs: + ci: + name: ci + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cleanup + run: sed -i "s/grapecoveDCache[chisel3]/test/g" build.sc + - name: Cache Scala + uses: coursier/cache-action@v6 + - name: Setup Scala + uses: coursier/setup-action@v1 + with: + jvm: adopt:11 + apps: sbt mill + - name: Setup Dependencies + run: | + sudo apt-get install ccache + - name: Install Verilator + run: | + sudo apt-get install verilator + - name: Init Submodule + run: | + make init + - name: Cache Test + run: | + make test + diff --git a/.github/workflows/template-cleanup.yml b/.github/workflows/template-cleanup.yml deleted file mode 100644 index 8c394eb62..000000000 --- a/.github/workflows/template-cleanup.yml +++ /dev/null @@ -1,62 +0,0 @@ -# Workflow to cleanup projects created from this template -# Adapted from workflow of the same name in https://github.com/JetBrains/intellij-platform-plugin-template -# SPDX-License-Identifier: Apache-2.0 - -name: Template Cleanup -on: - push: - branches: [main] - -jobs: - # Triggered on first push to repos created from the template - template-cleanup: - name: Template Cleanup - permissions: - contents: write - runs-on: ubuntu-latest - if: github.event.repository.name != 'chisel-template' - steps: - - - name: Checkout - uses: actions/checkout@v4 - with: - # These are needed to make ad-m/github-push-action work - # https://github.com/ad-m/github-push-action/tree/d91a481090679876dfc4178fef17f286781251df#example-workflow-file - persist-credentials: false - fetch-depth: 0 - - - name: Cleanup - run: | - export LC_CTYPE=C - export LANG=C - - # Prepare variables - NAME="${GITHUB_REPOSITORY##*/}" - ORG="$GITHUB_REPOSITORY_OWNER" - SAFE_ORG=$(echo $ORG | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') - GROUP="com.github.$SAFE_ORG" - - # Replace placeholders - sed -i "s/%NAME%/$NAME/g" build.sbt build.sc README.md src/test/scala/gcd/* - sed -i "s/%REPOSITORY%/${GITHUB_REPOSITORY/\//\\/}/g" README.md - sed -i "s/%ORGANIZATION%/$GROUP/g" build.sbt - - # Remove lines marked with #REMOVE-ON-CLEANUP# - sed -i '/#REMOVE-ON-CLEANUP#/d' README.md - - rm -rf \ - .github/workflows/template-cleanup.yml \ - LICENSE - - - name: Commit - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "Template cleanup" - - - name: Push changes - uses: ad-m/github-push-action@v0.8.0 - with: - branch: main - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index eb323e72e..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Continuous Integration - -on: - push: - tags: ['*'] - branches: ['main'] - pull_request: - workflow_dispatch: - -env: - verilator-version: v5.022 - verilator-install-dir: verilator-install - -jobs: - ci: - name: ci - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Cleanup - run: sed -i "s/%NAME%/test/g" build.sc - - name: Cache Scala - uses: coursier/cache-action@v6 - - name: Setup Scala - uses: coursier/setup-action@v1 - with: - jvm: adopt:11 - apps: sbt mill - - name: Setup Dependencies - run: | - sudo apt-get install ccache - - name: Get Cached Verilator - id: get-cached-verilator - uses: actions/cache@v4 - with: - path: ${{ env.verilator-install-dir }} - key: verilator-${{ env.verilator-version }} - - name: Install Verilator - if: steps.get-cached-verilator.outputs.cache-hit != 'true' - run: | - sudo apt-get install git help2man perl python3 make autoconf g++ flex bison numactl perl-doc libfl-dev - git clone https://github.com/verilator/verilator - unset VERILATOR_ROOT - cd verilator - git checkout ${{ env.verilator-version }} - autoconf - ./configure --prefix=$(pwd)/../${{ env.verilator-install-dir }} - make - make install - - name: Set PATH - run: | - echo "$(pwd)/${{ env.verilator-install-dir }}/bin" >> $GITHUB_PATH - echo VERILATOR_ROOT="$(pwd)/${{ env.verilator-install-dir }}/share/verilator" >> $GITHUB_ENV - ln -sf $(pwd)/${{ env.verilator-install-dir }}/bin/verilator_bin $(pwd)/${{ env.verilator-install-dir }}/share/verilator/verilator_bin - - name: SBT Test - run: sbt test - - name: mill Test - run: mill _.test