Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
ci: disallow warnings in PRs (#603)
Browse files Browse the repository at this point in the history
* ci: disallow warnings in PRs

* disable test that produces warning because of utest issue
  • Loading branch information
ekiwi authored Jan 9, 2023
1 parent 129d82c commit 005899f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,34 @@ jobs:
- name: Check Formatting
run: sbt scalafmtCheckAll

no-warn:
name: No Warnings with Scala 2.13 for PRs
if: github.event_name == 'pull_request'
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check for Warnings
run: sbt "set ThisBuild / scalacOptions ++= Seq(\"-Xfatal-warnings\") ; compile"
- name: Check for Warnings in Tests
run: sbt "set ThisBuild / scalacOptions ++= Seq(\"-Xfatal-warnings\") ; Test / compile"

# Sentinel job to simplify how we specify which checks need to pass in branch
# protection and in Mergify
#
# When adding new jobs, please add them to `needs` below
all_tests_passed:
name: "all tests passed"
needs: [test, doc, verilator, formal, formal-mac, icarus, test-mac]
needs: [test, doc, verilator, formal, formal-mac, icarus, test-mac, no-warn]
runs-on: ubuntu-latest
steps:
- run: echo Success!

# sbt ci-release publishes all cross versions so this job needs to be
# separate from a Scala versions build matrix to avoid duplicate publishing
publish:
needs: [all_tests_passed]
# note: we do not require a warning check for publishing!
needs: [test, doc, verilator, formal, formal-mac, icarus, test-mac]
runs-on: ubuntu-20.04
if: github.event_name == 'push'

Expand Down
16 changes: 10 additions & 6 deletions src/test/scala/chiseltest/tests/UtestTesterTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ package chiseltest.tests

import utest._
import chiseltest._
import chisel3._
// import chisel3._

object UtestTesterTest extends ChiselUtestTester {
val tests = Tests {
test("This tester does not rely on scalatest to run") {
testCircuit(new StaticModule(42.U)) { c =>
c.out.expect(42.U)
}
}
// TODO: This test can be re-enabled once the following upstream issue is fixed:
// https://github.com/com-lihaoyi/utest/issues/237
// Currently is results in a warning and we haven't been able to figure out
// how to work around the upstream problem.
// test("This tester does not rely on scalatest to run") {
// testCircuit(new StaticModule(42.U)) { c =>
// c.out.expect(42.U)
// }
// }
}
}

0 comments on commit 005899f

Please sign in to comment.