From 7f03a1f73d53725246ac8168427076a0050f47ae Mon Sep 17 00:00:00 2001 From: Avimitin Date: Mon, 29 Jul 2024 20:57:39 +0800 Subject: [PATCH] [ci] add VCS CI --- .github/workflows/vcs.yml | 6 +++--- script/ci/src/Main.scala | 17 +++++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/vcs.yml b/.github/workflows/vcs.yml index 984b73e8c2..050c63e445 100644 --- a/.github/workflows/vcs.yml +++ b/.github/workflows/vcs.yml @@ -30,7 +30,7 @@ jobs: run: echo "out=$(nix run .#ci-helper generateTestPlan)" > $GITHUB_OUTPUT build-emulators: - name: "Build Emulators" + name: "Build VCS Emulators" needs: [gen-test-plan] runs-on: [self-hosted, linux, nixos, BIGRAM] strategy: @@ -70,7 +70,7 @@ jobs: nix run ".#ci-helper" -- generateCiMatrix --runnersAmount "$RUNNERS" >> "$GITHUB_OUTPUT" run-testcases: - name: "Run testcases" + name: "Run VCS" needs: [gen-matrix] strategy: fail-fast: false @@ -85,7 +85,7 @@ jobs: nix run ".#ci-helper" -- runTests --jobs "${{ matrix.jobs }}" --testType "vcs" report: - name: "Report CI result" + name: "Report VCS CI result" # Don't run report when: # - user cancel ( we don't need report at this case ) # - PR from outside repository ( we don't have permission to push commit into fork repository ) diff --git a/script/ci/src/Main.scala b/script/ci/src/Main.scala index 9faab1fa82..23a98e2007 100644 --- a/script/ci/src/Main.scala +++ b/script/ci/src/Main.scala @@ -157,7 +157,7 @@ object Main: val Array(config, caseName) = testName.split(",") println("\n") Logger.info( - s"${BOLD}[${index + 1}/${allJobs.length}]${RESET} Running test case $caseName with config $config" + s"${BOLD}[${index + 1}/${allJobs.length}]${RESET} Running VCS for test case $caseName with config $config" ) val testAttr = testType.toLowerCase() match @@ -170,25 +170,18 @@ object Main: os.Path( nixResolvePath( testAttr, - if testAttr == "vcs" then Seq("--impure") else Seq() + if testType == "vcs" then Seq("--impure") else Seq() ) ) catch case _ => - Logger.error(s"Emulation for config $config, case $caseName fail") + Logger.error(s"VCS emulation for config $config, case $caseName fail") println("-" * 50) - println( - os.proc( - "nix", - "log", - s".#t1.$config.cases.$caseName.emu-result" - ).call() - .out - ) + println(os.proc("nix", "log", testAttr).call().out) println("-" * 50) Logger.fatal("Got error from emulation, exiting CI") - Logger.info("Checking RTL event with offline difftest") + Logger.info("Checking RTL event from VCS") val testSuccess = os.read(testResultPath / "offline-check-status").trim() == "0" if !testSuccess then